chore(deploy): include UTC-safe checks for active canvas tasks
This commit is contained in:
parent
fc96cccd56
commit
36df8c70fb
11
scripts/zcode-agent/active-run-deploy-check.sql
Normal file
11
scripts/zcode-agent/active-run-deploy-check.sql
Normal file
@ -0,0 +1,11 @@
|
||||
-- Application timestamps are UTC stored without time zone. Compare them to an
|
||||
-- explicit UTC clock; an implicit cast uses the database session's time zone
|
||||
-- and can incorrectly report active tasks as eight hours old.
|
||||
SELECT json_build_object(
|
||||
'images', (SELECT count(*) FROM "CanvasImageTask"
|
||||
WHERE status IN ('pending', 'running')
|
||||
AND "updatedAt" > timezone('UTC', clock_timestamp()) - interval '90 minutes'),
|
||||
'agents', (SELECT count(*) FROM "CanvasAgentRun"
|
||||
WHERE status = 'running'
|
||||
AND "updatedAt" > timezone('UTC', clock_timestamp()) - interval '2 minutes')
|
||||
);
|
||||
Loading…
x
Reference in New Issue
Block a user