mirror of
https://github.com/ClusterCockpit/cc-backend
synced 2026-03-04 07:07:30 +01:00
Further optimize queries for better index usage
This commit is contained in:
@@ -718,7 +718,7 @@ func (r *JobRepository) StopJobsExceedingWalltimeBy(seconds int) error {
|
||||
Set("job_state", schema.JobStateFailed).
|
||||
Where("job.job_state = 'running'").
|
||||
Where("job.walltime > 0").
|
||||
Where("(? - job.start_time) > (job.walltime + ?)", currentTime, seconds).
|
||||
Where("job.start_time < (? - job.walltime)", currentTime-int64(seconds)).
|
||||
RunWith(r.DB).Exec()
|
||||
if err != nil {
|
||||
cclog.Warnf("Error while stopping jobs exceeding walltime: %v", err)
|
||||
|
||||
Reference in New Issue
Block a user