fix case where job removed causes panic when rescheduling (#698)

This commit is contained in:
John Roesler
2024-03-23 13:57:09 -05:00
committed by GitHub
parent b0bd435279
commit 41dd412a49
+6 -1
View File
@@ -288,7 +288,12 @@ func (s *scheduler) selectRemoveJob(id uuid.UUID) {
// Jobs coming back from the executor to the scheduler that
// need to evaluated for rescheduling.
func (s *scheduler) selectExecJobIDsOut(id uuid.UUID) {
j := s.jobs[id]
j, ok := s.jobs[id]
if !ok {
// the job was removed while it was running, and
// so we don't need to reschedule it.
return
}
j.lastRun = j.nextRun
// if the job has a limited number of runs set, we need to