mirror of
https://github.com/gadgethd/ukmesh.git
synced 2026-09-16 12:02:35 +00:00
fix: prune retired worker health status
This commit is contained in:
@@ -498,6 +498,12 @@ export async function captureWorkerHealthSnapshot(): Promise<void> {
|
||||
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,
|
||||
|
||||
Reference in New Issue
Block a user