feat: implement automated sync service with cron scheduling and web dashboard
This commit is contained in:
1 parent
e20c253df8
commit
2839a615fd
2 files changed
+4
-4
No files matched your search
+3
-3
@@ -78,8 +78,8 @@ if (forceMode) {
|
||||
});
|
||||
} else {
|
||||
startDashboard();
|
||||
console.log('Service sync démarré — cron: 0 6 * * * (6h00 chaque nuit)');
|
||||
cron.schedule('0 6 * * *', () => {
|
||||
console.log('Service sync démarré — cron: 45 6 * * * Europe/Paris (6h45 chaque nuit)');
|
||||
cron.schedule('45 6 * * *', () => {
|
||||
syncAll(false).catch(err => console.error('Erreur cron sync:', err.message));
|
||||
});
|
||||
}, { timezone: 'Europe/Paris' });
|
||||
}
|
||||
+1
-1
@@ -85,7 +85,7 @@ app.get('/api/logs', (req, res) => {
|
||||
app.get('/api/next', (req, res) => {
|
||||
const now = new Date();
|
||||
const next = new Date(now);
|
||||
next.setHours(3, 0, 0, 0);
|
||||
next.setHours(6, 45, 0, 0);
|
||||
if (next <= now) next.setDate(next.getDate() + 1);
|
||||
res.json({ next: next.toISOString() });
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user