mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2024-12-26 05:19:05 +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 {
|
func (r *JobRepository) UpdateDuration() error {
|
||||||
if _, err := sq.Update("job").
|
stmnt := sq.Update("job").
|
||||||
Set("duration", sq.Expr("? - job.start_time", time.Now().Unix())).
|
Set("duration", sq.Expr("? - job.start_time", time.Now().Unix())).
|
||||||
Where("job_state = running").
|
Where("job_state = running")
|
||||||
RunWith(r.stmtCache).Exec(); err != nil {
|
sql, _, err := stmnt.ToSql()
|
||||||
|
log.Infof("Duration Update query %s", sql)
|
||||||
|
|
||||||
|
_, err = stmnt.RunWith(r.stmtCache).Exec()
|
||||||
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user