mirror of
https://github.com/andrey271192/Domain_web.git
synced 2026-09-20 14:41:58 +00:00
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>
28 lines
723 B
TypeScript
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);
|
|
});
|