2
0
mirror of https://github.com/hibiken/asynq.git synced 2024-09-20 11:05:58 +08:00

Add Pause and Unpause queue methods to Inspector

This commit is contained in:
Ken Hibino 2020-07-28 21:56:48 -07:00
parent a913e6d73f
commit 5f06c308f0

View File

@ -486,3 +486,15 @@ func (i *Inspector) KillTaskByKey(key string) error {
return fmt.Errorf("invalid key") return fmt.Errorf("invalid key")
} }
} }
// PauseQueue pauses task processing on the specified queue.
// If the queue is already paused, it will return a non-nil error.
func (i *Inspector) PauseQueue(qname string) error {
return i.rdb.Pause(qname)
}
// UnpauseQueue resumes task processing on the specified queue.
// If the queue is not paused, it will return a non-nil error.
func (i *Inspector) UnpauseQueue(qname string) error {
return i.rdb.Unpause(qname)
}