Files
Void-Homelab/lib/jobs/workers/health_check.js
root ce26895d8e feat: 2.0.0-alpha.11 — DB-backed service registry + LAN auto-discovery
- monitored_services table (mig 015) replaces config/services.json (now a boot seed)
- owner CRUD over /api/health/services; GET is DB-backed; cron+worker read the DB
- discover.lan worker: pure-Node TCP sweep + HTTP-title probe -> disabled 'discovered'
  candidates (never clobbers curated entries); POST /api/health/discover + GET .../discovered
- dashboard: Scan button + Discovered(N) section with one-click promote

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-04 07:55:08 +10:00

9 lines
377 B
JavaScript

import { checkAll } from '../../health/checker.js';
import * as statusRepo from '../../db/repos/service_status.js';
import * as services from '../../db/repos/monitored_services.js';
export const NAME = 'health.check';
export async function handler(_job) {
const results = await checkAll(await services.listEnabled());
for (const r of results) await statusRepo.upsert(r);
}