Skip to content

Commit dc70114

Browse files
committed
cleanup
1 parent c455a94 commit dc70114

File tree

1 file changed

+0
-52
lines changed

1 file changed

+0
-52
lines changed

coderd/database/dbmem/dbmem.go

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -3979,58 +3979,6 @@ func (q *FakeQuerier) GetProvisionerJobsByOrganizationAndStatusWithQueuePosition
39793979
defer q.mutex.RUnlock()
39803980

39813981
/*
3982-
-- name: GetProvisionerJobsByOrganizationAndStatusWithQueuePositionAndProvisioner :many
3983-
WITH unstarted_jobs AS (
3984-
SELECT
3985-
id, created_at
3986-
FROM
3987-
provisioner_jobs
3988-
WHERE
3989-
started_at IS NULL
3990-
),
3991-
queue_position AS (
3992-
SELECT
3993-
id,
3994-
ROW_NUMBER() OVER (ORDER BY created_at ASC) AS queue_position
3995-
FROM
3996-
unstarted_jobs
3997-
),
3998-
queue_size AS (
3999-
SELECT COUNT(*) AS count FROM unstarted_jobs
4000-
)
4001-
SELECT
4002-
sqlc.embed(pj),
4003-
COALESCE(qp.queue_position, 0) AS queue_position,
4004-
COALESCE(qs.count, 0) AS queue_size,
4005-
array_agg(DISTINCT pd.id) FILTER (WHERE pd.id IS NOT NULL)::uuid[] AS available_workers
4006-
FROM
4007-
provisioner_jobs pj
4008-
LEFT JOIN
4009-
queue_position qp ON qp.id = pj.id
4010-
LEFT JOIN
4011-
queue_size qs ON TRUE
4012-
LEFT JOIN
4013-
provisioner_daemons pd ON (
4014-
-- See AcquireProvisionerJob.
4015-
pj.started_at IS NULL
4016-
AND pj.organization_id = pd.organization_id
4017-
AND pj.provisioner = ANY(pd.provisioners)
4018-
AND provisioner_tagset_contains(pd.tags, pj.tags)
4019-
)
4020-
WHERE
4021-
(sqlc.narg('organization_id')::uuid IS NULL OR pj.organization_id = @organization_id)
4022-
AND (COALESCE(array_length(@status::provisioner_job_status[], 1), 1) > 0 OR pj.job_status = ANY(@status::provisioner_job_status[]))
4023-
GROUP BY
4024-
pj.id,
4025-
qp.queue_position,
4026-
qs.count
4027-
ORDER BY
4028-
pj.created_at DESC
4029-
LIMIT
4030-
sqlc.narg('limit')::int;
4031-
4032-
AMENDED QUERY:
4033-
40343982
-- name: GetProvisionerJobsByOrganizationAndStatusWithQueuePositionAndProvisioner :many
40353983
WITH pending_jobs AS (
40363984
SELECT

0 commit comments

Comments
 (0)