mirror of
https://github.com/hibiken/asynq.git
synced 2025-04-22 00:30:17 +08:00
Add Pause and Unpause queue methods to Inspector
This commit is contained in:
parent
b2ed2fa97b
commit
6ff08a1767
12
inspector.go
12
inspector.go
@ -486,3 +486,15 @@ func (i *Inspector) KillTaskByKey(key string) error {
|
||||
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)
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user