Review funkt

This commit is contained in:
2026-08-09 21:56:00 +00:00
parent f522ae9953
commit fe9dfa4519
11366 changed files with 2335077 additions and 97 deletions

View File

@@ -0,0 +1,13 @@
-- Job counts by state for a queue. Param: $1 queue.
-- "prioritized" = waiting with priority > 0; "waiting" = waiting with priority 0.
SELECT
COUNT(*) FILTER (WHERE state = 'active') AS active,
COUNT(*) FILTER (WHERE state = 'completed') AS completed,
COUNT(*) FILTER (WHERE state = 'failed') AS failed,
COUNT(*) FILTER (WHERE state = 'delayed') AS delayed,
COUNT(*) FILTER (WHERE state = 'waiting' AND priority = 0) AS waiting,
COUNT(*) FILTER (WHERE state = 'waiting' AND priority > 0) AS prioritized,
COUNT(*) FILTER (WHERE state = 'waiting-children') AS "waiting-children",
(SELECT value FROM meta WHERE queue = $1 AND field = 'paused') AS paused
FROM job
WHERE queue = $1;