Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6243ff0

Browse files
committed
removed the 'started' constraint from unhanger
1 parent 2696926 commit 6243ff0

File tree

3 files changed

+0
-10
lines changed

3 files changed

+0
-10
lines changed

coderd/database/queries.sql.go

Lines changed: 0 additions & 1 deletion
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: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,6 @@ FROM
263263
provisioner_jobs
264264
WHERE
265265
updated_at < $1
266-
AND started_at IS NOT NULL
267266
AND completed_at IS NULL;
268267

269268
-- name: InsertProvisionerJobTimings :many

coderd/unhanger/detector.go

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -229,14 +229,6 @@ func unhangJob(ctx context.Context, log slog.Logger, db database.Store, pub pubs
229229
return xerrors.Errorf("get provisioner job: %w", err)
230230
}
231231

232-
// Check if we should still unhang it.
233-
if !job.StartedAt.Valid {
234-
// This shouldn't be possible to hit because the query only selects
235-
// started and not completed jobs, and a job can't be "un-started".
236-
return jobIneligibleError{
237-
Err: xerrors.New("job is not started"),
238-
}
239-
}
240232
if job.CompletedAt.Valid {
241233
return jobIneligibleError{
242234
Err: xerrors.Errorf("job is completed (status %s)", job.JobStatus),

0 commit comments

Comments
 (0)