Skip to content

Commit

Permalink
Add debug output to duration query
Browse files Browse the repository at this point in the history
  • Loading branch information
moebiusband73 committed Sep 5, 2024
1 parent 508978d commit 53ca38c
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions internal/repository/job.go
Original file line number Diff line number Diff line change
Expand Up @@ -484,10 +484,14 @@ func (r *JobRepository) FindRunningJobs(cluster string) ([]*schema.Job, error) {
}

func (r *JobRepository) UpdateDuration() error {
if _, err := sq.Update("job").
stmnt := sq.Update("job").
Set("duration", sq.Expr("? - job.start_time", time.Now().Unix())).
Where("job_state = running").
RunWith(r.stmtCache).Exec(); err != nil {
Where("job_state = running")
sql, _, err := stmnt.ToSql()
log.Infof("Duration Update query %s", sql)

_, err = stmnt.RunWith(r.stmtCache).Exec()
if err != nil {
return err
}

Expand Down

0 comments on commit 53ca38c

Please sign in to comment.