feat: Allow configuring category sync interval via environment variable and log next sync time.
This commit is contained in:
@@ -62,6 +62,11 @@ class CategorySyncer extends EventEmitter {
|
||||
await this._syncFromDb();
|
||||
const duration = Date.now() - startTime;
|
||||
console.log(`✅ Sync completed successfully in ${duration}ms.`);
|
||||
|
||||
// Log next sync time
|
||||
const syncInterval = parseInt(process.env.SYNC_INTERVAL_MS) || 60000;
|
||||
const minutes = Math.round(syncInterval / 60000);
|
||||
console.log(`⏰ Next sync in ${minutes} minute${minutes !== 1 ? 's' : ''}`);
|
||||
} catch (err) {
|
||||
console.error('❌ Sync failed:', err);
|
||||
} finally {
|
||||
|
||||
Reference in New Issue
Block a user