Skip to content

Commit 57b6276

Browse files
committed
feat(wrtagweb): record job update time
1 parent 4aa435e commit 57b6276

File tree

3 files changed

+10
-3
lines changed

3 files changed

+10
-3
lines changed

cmd/wrtagweb/main.gen.go

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

cmd/wrtagweb/main.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,7 @@ func main() {
333333
}
334334

335335
var job Job
336-
if err := sqlb.ScanRow(r.Context(), db, &job, "update jobs set confirm=?, use_mbid=?, status=? where id=? and status<>? returning *", confirm, useMBID, StatusEnqueued, id, StatusInProgress); err != nil {
336+
if err := sqlb.ScanRow(r.Context(), db, &job, "update jobs set confirm=?, use_mbid=?, status=?, updated_time=? where id=? and status<>? returning *", confirm, useMBID, StatusEnqueued, time.Now(), id, StatusInProgress); err != nil {
337337
respErrf(w, http.StatusInternalServerError, "error getting job")
338338
return
339339
}
@@ -514,6 +514,7 @@ type Job struct {
514514
Error string
515515
Operation string
516516
Time time.Time
517+
UpdatedTime sql.NullTime
517518
UseMBID string
518519
SourcePath string
519520
DestPath string

cmd/wrtagweb/schema.sql

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,3 +26,7 @@ alter table jobs
2626
-- 2024.04.01 add confirm bool --
2727
alter table jobs
2828
add column confirm boolean default false;
29+
30+
-- 2025.09.14 add updated_time timestamp --
31+
alter table jobs
32+
add column updated_time timestamp;

0 commit comments

Comments
 (0)