feat(health): /api/health/services (grouped+counts) + owner /check
Adds GET /api/health/services returning registry services grouped by category with merged cached status and per-group healthy counts, and POST /api/health/check (owner-only) that enqueues a health.check pg-boss job. Registers the health_check worker in the jobs index.
This commit is contained in:
8
lib/jobs/workers/health_check.js
Normal file
8
lib/jobs/workers/health_check.js
Normal file
@@ -0,0 +1,8 @@
|
||||
import { load } from '../../health/registry.js';
|
||||
import { checkAll } from '../../health/checker.js';
|
||||
import * as statusRepo from '../../db/repos/service_status.js';
|
||||
export const NAME = 'health.check';
|
||||
export async function handler(_job) {
|
||||
const results = await checkAll(load());
|
||||
for (const r of results) await statusRepo.upsert(r);
|
||||
}
|
||||
Reference in New Issue
Block a user