82
}
83
85
>
if !atomic.CompareAndSwapInt32(
86
>
&s.status,
87
>
common.DaemonStatusStarted,
88
>
common.DaemonStatusStopped,
89
>
) {
90
return
91
}
92
94
>
s.workerCountSubscriptionCancelFn()
95
>
s.updateWorkerCount(0)
96
>
// must be called after the close of the shutdownChan
97
>
s.drainTasks()
98
>
99
>
go func() {
100
>
if success := common.AwaitWaitGroup(&s.shutdownWG, time.Minute); !success {
101
s.logger.Warn("sequential scheduler timed out waiting for workers")
102
}
103
}()
105
}
106