Skip to content

Commit 3815727

Browse files
committed
Revert "filling out started_at when unhanging not started jobs"
This reverts commit 4b252eb.
1 parent af994c2 commit 3815727

File tree

3 files changed

+3
-18
lines changed

3 files changed

+3
-18
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 & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -252,8 +252,7 @@ SET
252252
updated_at = $2,
253253
completed_at = $3,
254254
error = $4,
255-
error_code = $5,
256-
started_at = $6
255+
error_code = $5
257256
WHERE
258257
id = $1;
259258

coderd/reaper/detector.go

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -309,22 +309,11 @@ func reapJob(ctx context.Context, log slog.Logger, db database.Store, pub pubsub
309309
}
310310
lowestLogID = newLogs[0].ID
311311

312-
now = dbtime.Now()
313-
314-
// If we are failing a job that was never picked up by the
315-
// provisioner, we need to set the started_at time to the current
316-
// time so that the build duration is correct.
317-
if !job.StartedAt.Valid {
318-
job.StartedAt = sql.NullTime{
319-
Time: now,
320-
Valid: true,
321-
}
322-
}
323312
// Mark the job as failed.
313+
now = dbtime.Now()
324314
err = db.UpdateProvisionerJobWithCompleteByID(ctx, database.UpdateProvisionerJobWithCompleteByIDParams{
325315
ID: job.ID,
326316
UpdatedAt: now,
327-
StartedAt: job.StartedAt,
328317
CompletedAt: sql.NullTime{
329318
Time: now,
330319
Valid: true,

0 commit comments

Comments
 (0)