2
0
mirror of https://github.com/hibiken/asynq.git synced 2026-06-15 12:23:30 +08:00

Stop processing more tasks from the queue once TSTP signal is received

This commit is contained in:
Ken Hibino
2019-12-17 06:18:22 -08:00
parent 3e30c5916b
commit 24dd78b31c
2 changed files with 16 additions and 5 deletions

View File

@@ -80,9 +80,8 @@ func (bg *Background) Run(handler Handler) {
signal.Notify(sigs, syscall.SIGTERM, syscall.SIGINT, syscall.SIGTSTP)
for {
sig := <-sigs
fmt.Printf("[DEBUG] Got %v\n", sig) // TODO: Remove this
if sig == syscall.SIGTSTP {
fmt.Println("[DEBUG] Stop processing tasks")
bg.processor.stop()
continue
}
break