2
0
mirror of https://github.com/hibiken/asynq.git synced 2024-12-24 23:02:18 +08:00

Modify poller to wait for Time.After channel instead of time.Sleep

This commit is contained in:
Ken Hibino 2019-12-17 20:13:41 -08:00
parent 5ddba8ca98
commit c40e779fdb

View File

@ -39,9 +39,8 @@ func (p *poller) start() {
case <-p.done:
log.Println("[INFO] Poller done.")
return
default:
case <-time.After(p.avgInterval):
p.exec()
time.Sleep(p.avgInterval)
}
}
}()