mirror of
https://github.com/hibiken/asynq.git
synced 2024-12-27 16:13:40 +08:00
Add Pause and Unpause queue methods to Inspector
This commit is contained in:
parent
a913e6d73f
commit
5f06c308f0
12
inspector.go
12
inspector.go
@ -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)
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user