mirror of
https://github.com/andrey271192/Domain_web.git
synced 2026-11-04 00:43:06 +00:00
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>
This commit is contained in:
27
scripts/monitor-worker.ts
Normal file
27
scripts/monitor-worker.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
/**
|
||||
* 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);
|
||||
});
|
||||
Reference in New Issue
Block a user