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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user