latest changes and fixes

This commit is contained in:
José Conde
2023-09-09 18:24:57 +02:00
parent 15f012530e
commit ed51c02ddc
18 changed files with 470 additions and 132 deletions

View File

@ -18,6 +18,7 @@ async function taskSyncLSAUsers() {
['users_whitelist', whitelist],
]);
} catch (err) {
console.log('err :>> ', err);
console.log('ERR executing taskSyncLSAUsers');
}
}
@ -40,16 +41,21 @@ async function taskSyncPrevioudDaySessions(callsign) {
}
module.exports = function() {
if (canRunTasks) {
cron.schedule(process.env.SYNC_TASK_SCHEDULE, () => {
taskSyncPrevioudDaySessions('LTS');
});
cron.schedule(process.env.USERS_TASK_SCHEDULE, async() => {
taskSyncLSAUsers();
});
console.log('Tasks started.');
} else {
console.log('Tasks skipped.');
}
}
module.exports = {
sync: function() {
console.log('canRunTasks :>> ', canRunTasks);
if (canRunTasks) {
cron.schedule(process.env.SYNC_TASK_SCHEDULE, () => {
taskSyncPrevioudDaySessions('LTS');
});
// cron.schedule(process.env.USERS_TASK_SCHEDULE, async() => {
// taskSyncLSAUsers();
// });
console.log('Tasks started.');
} else {
console.log('Tasks skipped.');
}
},
taskSyncLSAUsers,
taskSyncPrevioudDaySessions,
};