mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2025-01-28 20:15:17 +01:00
Bugfix in footprint update
This commit is contained in:
parent
5e65e21f0b
commit
7c33dcf630
@ -487,10 +487,8 @@ func (r *JobRepository) UpdateDuration() error {
|
|||||||
stmnt := 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'")
|
||||||
sql, _, err := stmnt.ToSql()
|
|
||||||
log.Infof("Duration Update query %s", sql)
|
|
||||||
|
|
||||||
_, err = stmnt.RunWith(r.stmtCache).Exec()
|
_, err := stmnt.RunWith(r.stmtCache).Exec()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
@ -85,11 +85,14 @@ func RegisterFootprintWorker() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
stmt := sq.Update("job").Where("job.id = ?", job.ID)
|
stmt := sq.Update("job").Where("job.id = ?", job.ID)
|
||||||
if stmt, err = jobRepo.UpdateFootprint(stmt, jobMeta); err != nil {
|
stmt, err = jobRepo.UpdateFootprint(stmt, jobMeta)
|
||||||
|
if err != nil {
|
||||||
log.Errorf("Update job (dbid: %d) failed at update Footprint step: %s", job.ID, err.Error())
|
log.Errorf("Update job (dbid: %d) failed at update Footprint step: %s", job.ID, err.Error())
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if stmt, err = jobRepo.UpdateEnergy(stmt, jobMeta); err != nil {
|
|
||||||
|
stmt, err = jobRepo.UpdateEnergy(stmt, jobMeta)
|
||||||
|
if err != nil {
|
||||||
log.Errorf("Update job (dbid: %d) failed at update Energy step: %s", job.ID, err.Error())
|
log.Errorf("Update job (dbid: %d) failed at update Energy step: %s", job.ID, err.Error())
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user