Only autostop jobs with a positive walltime

This commit is contained in:
Lou Knauer
2022-05-09 11:53:41 +02:00
parent cdfb144b82
commit 9d49fea48a
2 changed files with 14 additions and 12 deletions

View File

@@ -378,6 +378,7 @@ func (r *JobRepository) StopJobsExceedingWalltimeBy(seconds int) error {
Set("duration", 0).
Set("job_state", schema.JobStateFailed).
Where("job.job_state = 'running'").
Where("job.walltime > 0").
Where(fmt.Sprintf("(%d - job.start_time) > (job.walltime + %d)", time.Now().Unix(), seconds)).
RunWith(r.DB).Exec()
if err != nil {