Skip to content

Commit

Permalink
move singleton runner map to be fresh on executor start
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnRoesler committed Nov 14, 2023
1 parent 9a3fd98 commit 10ea898
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions executor.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@ func (e *executor) start() {
mu: sync.Mutex{},
}

// create a fresh map for tracking singleton runners
e.singletonRunners = make(map[uuid.UUID]singletonRunner)

// start the for leap that is the executor
// selecting on channels for work to do
for {
Expand Down Expand Up @@ -267,10 +270,6 @@ func (e *executor) stop(standardJobsWg, singletonJobsWg, limitModeJobsWg *waitGr
count++
case <-waitForSingletons:
count++
// emptying the singleton runner map
// as we'll need to spin up new runners
// in the event that the scheduler is started again
e.singletonRunners = make(map[uuid.UUID]singletonRunner)
case <-waitForLimitMode:
count++
default:
Expand Down

0 comments on commit 10ea898

Please sign in to comment.