mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2024-11-10 00:47:26 +01:00
Add debug output to duration query
This commit is contained in:
parent
508978d586
commit
53ca38ce53
@ -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
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user