Skip to content

Commit

Permalink
fix case where job removed causes panic when rescheduling (#698)
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnRoesler committed Mar 23, 2024
1 parent b0bd435 commit 41dd412
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion scheduler.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 41dd412

Please sign in to comment.