From b119b37b87d6a252b2b1c0c645589a102c877e92 Mon Sep 17 00:00:00 2001 From: Trevor Mears Date: Sun, 4 Jan 2026 02:01:08 -0800 Subject: [PATCH] Updated sync timer logging --- server/services/syncService.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/server/services/syncService.js b/server/services/syncService.js index 1c04ac5..bf84df4 100644 --- a/server/services/syncService.js +++ b/server/services/syncService.js @@ -40,19 +40,25 @@ class SyncService { const intervalMs = intervalHours * 60 * 60 * 1000; - // Don't restart if interval hasn't changed + // Don't restart if interval hasn't changed and timer exists if (this._currentInterval === intervalHours && this._syncTimer) { + console.log(`[Sync] Timer already running for ${intervalHours} hours, not restarting`); return; } // Clear existing timer this.stopSyncTimer(); + const nextSyncTime = new Date(Date.now() + intervalMs); console.log(`[Sync] Starting server-side sync timer: every ${intervalHours} hours`); + console.log(`[Sync] Next scheduled sync at: ${nextSyncTime.toLocaleString()}`); this._syncTimer = setInterval(async () => { console.log('[Sync] Scheduled sync triggered'); await this.syncAll(); + // Log next sync time + const next = new Date(Date.now() + intervalMs); + console.log(`[Sync] Next scheduled sync at: ${next.toLocaleString()}`); }, intervalMs); this._currentInterval = intervalHours;