Skip to content

Commit c4316fd

Browse files
refactor(coderd/database): use job_status generated column
1 parent 8b3446e commit c4316fd

File tree

2 files changed

+2
-8
lines changed

2 files changed

+2
-8
lines changed

coderd/database/queries.sql.go

Lines changed: 1 addition & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/database/queries/provisionerjobs.sql

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -63,10 +63,7 @@ pending_jobs AS (
6363
-- Step 2: Extract only pending jobs
6464
SELECT *
6565
FROM provisioner_jobs
66-
WHERE started_at IS NULL
67-
AND canceled_at IS NULL
68-
AND completed_at IS NULL
69-
AND error IS NULL
66+
WHERE job_status = 'pending'
7067
),
7168
ranked_jobs AS (
7269
-- Step 3: Rank only pending jobs based on provisioner availability

0 commit comments

Comments
 (0)