File tree Expand file tree Collapse file tree 1 file changed +0
-52
lines changed Expand file tree Collapse file tree 1 file changed +0
-52
lines changed Original file line number Diff line number Diff line change @@ -3979,58 +3979,6 @@ func (q *FakeQuerier) GetProvisionerJobsByOrganizationAndStatusWithQueuePosition
3979
3979
defer q .mutex .RUnlock ()
3980
3980
3981
3981
/*
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
-
4034
3982
-- name: GetProvisionerJobsByOrganizationAndStatusWithQueuePositionAndProvisioner :many
4035
3983
WITH pending_jobs AS (
4036
3984
SELECT
You can’t perform that action at this time.
0 commit comments