Skip to content

Commit f1d5cda

Browse files
committed
overkill?
1 parent 2b30914 commit f1d5cda

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

coderd/database/queries.sql.go

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/database/queries/provisionerdaemons.sql

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ JOIN
5858
LEFT JOIN
5959
provisioner_jobs current_job ON (
6060
current_job.worker_id = pd.id
61+
AND current_job.organization_id = pd.organization_id
6162
AND current_job.completed_at IS NULL
6263
)
6364
LEFT JOIN
@@ -69,11 +70,13 @@ LEFT JOIN
6970
provisioner_jobs
7071
WHERE
7172
worker_id = pd.id
73+
AND organization_id = pd.organization_id
7274
AND completed_at IS NOT NULL
7375
ORDER BY
7476
completed_at DESC
7577
LIMIT 1
7678
)
79+
AND previous_job.organization_id = pd.organization_id
7780
)
7881
-- Current job information.
7982
LEFT JOIN

0 commit comments

Comments
 (0)