From 549aebff9126c74c9542daedb7bbe09534ef9cbb Mon Sep 17 00:00:00 2001 From: gadgethd <111318106+gadgethd@users.noreply.github.com> Date: Sun, 9 Aug 2026 19:44:33 +0000 Subject: [PATCH] fix: prune retired worker health status --- backend/src/health/status.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/backend/src/health/status.ts b/backend/src/health/status.ts index 4ef3fbd..c17537d 100644 --- a/backend/src/health/status.ts +++ b/backend/src/health/status.ts @@ -498,6 +498,12 @@ export async function captureWorkerHealthSnapshot(): Promise { last_activity_at, cpu_load_1m, mem_used_pct, disk_used_pct FROM snapshot RETURNING worker_name + ), current_cleanup AS ( + DELETE FROM worker_health_current current + WHERE NOT EXISTS ( + SELECT 1 FROM snapshot WHERE snapshot.worker_name = current.worker_name + ) + RETURNING worker_name ) INSERT INTO worker_health_current (worker_name, captured_at, status, queue_depth, processed_1h,