move singleton runner map to be fresh on executor start

This commit is contained in:
John Roesler
2023-11-14 13:52:19 -06:00
parent 9a3fd98dcc
commit 10ea8986c7
+3 -4
View File
@@ -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 {
@@ -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: