Files
Domain_web/scripts/monitor-worker.ts
Андрей Бобырев 010e053ca1 feat: monitors worker, auth register, scan polish
Add background DNS/SSL monitor checks, registration API, smoother SSE
with stage labels, improved CDN/WAF detection, light-theme UI polish,
and README roadmap updates.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-24 23:33:15 +03:00

28 lines
723 B
TypeScript

/**
* Background monitor checks (DNS change + SSL expiry MVP).
* Run via: npm run worker:monitors
*/
import { runAllMonitorChecks } from "../src/lib/monitoring/check";
const intervalMs = Number(process.env.MONITOR_INTERVAL_MS ?? 300_000);
async function tick() {
const summary = await runAllMonitorChecks();
console.log(
`[monitor-worker] ${new Date().toISOString()} checked=${summary.checked} with_alerts=${summary.alerts}`
);
}
async function main() {
await tick();
setInterval(() => {
tick().catch((e) => console.error("[monitor-worker]", e));
}, intervalMs);
console.log(`[monitor-worker] interval ${intervalMs / 1000}s`);
}
main().catch((e) => {
console.error(e);
process.exit(1);
});