2
0
mirror of https://github.com/hibiken/asynq.git synced 2024-12-25 07:12:17 +08:00

fix: Nil out handler reference after all workers have finished

This commit is contained in:
Ken Hibino 2019-11-23 17:09:57 -08:00
parent ac3190a0d5
commit 5eaf606a0d

View File

@ -55,6 +55,7 @@ func (bg *Background) start(handler TaskHandler) {
if bg.running {
return
}
bg.running = true
bg.processor.handler = handler
@ -69,9 +70,10 @@ func (bg *Background) stop() {
if !bg.running {
return
}
bg.running = false
bg.processor.handler = nil
bg.poller.terminate()
bg.processor.terminate()
bg.processor.handler = nil
bg.running = false
}