feat(devices): hourly scan-cycle orchestration + cron
This commit is contained in:
@@ -5,6 +5,7 @@ import { enqueue } from '../jobs/queue.js';
|
||||
import { checkAll } from '../health/checker.js';
|
||||
import * as statusRepo from '../db/repos/service_status.js';
|
||||
import * as services from '../db/repos/monitored_services.js';
|
||||
import { runDeviceScanCycle } from '../infra/scan_cycle.js';
|
||||
|
||||
export function startCron() {
|
||||
// Daily at 03:00 local time
|
||||
@@ -35,5 +36,11 @@ export function startCron() {
|
||||
} catch (e) { log.error({ err: e }, 'health check failed'); }
|
||||
});
|
||||
|
||||
// Hourly LAN device scan (staggered off the :00 speedtest)
|
||||
cron.schedule('7 * * * *', async () => {
|
||||
try { await runDeviceScanCycle(); }
|
||||
catch (e) { log.error({ err: e }, 'device scan cycle failed'); }
|
||||
});
|
||||
|
||||
log.info('cron started');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user