feat(site): implement dynamic site selection dropdown in sidebar and enable multi-site monitoring

This commit is contained in:
Rafif-Riqullah-Siregar committed 2026-07-13 16:57:45 +07:00
1 parent be6bc14190
commit 4882108068
125 files changed
+5666 -4305

No files matched your search

+7 -3
View File
@@ -49,7 +49,7 @@ async function runCollection() {
result = await collectAllAgents();
}
lastRunResult = { ...result, run_count: runCount };
// Log MongoDB database capacity usage (expensive full-scan aggregation).
// Only run periodically (default: every 24h) to avoid high CPU/DB load each cycle.
const now = Date.now();
@@ -58,7 +58,7 @@ async function runCollection() {
const { logCapacityStats } = require('../backend/db/capacityTracker');
await logCapacityStats(`[PROXY] [MongoDB] Capacity Used after Run #${runCount}:`);
}
return lastRunResult;
} catch (err) {
console.error('[Scheduler] Unhandled error during collection:', err.message);
@@ -95,7 +95,11 @@ function startScheduler() {
console.log('[Scheduler] Cron job registered. Starting initial collection...');
// Initial run immediately on startup (async, do not block server start)
setTimeout(() => {
setTimeout(async () => {
// 1. Sync dictionary first
// await netifyClient.syncApplicationDictionary();
// 2. Start normal telemetry collection
runCollection().catch(err => console.error('[Scheduler] Initial run error:', err.message));
}, 2000);
}