From 5f06c308f02343b7a58ee855bf266fe8c79c1131 Mon Sep 17 00:00:00 2001 From: Ken Hibino Date: Tue, 28 Jul 2020 21:56:48 -0700 Subject: [PATCH] Add Pause and Unpause queue methods to Inspector --- inspector.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/inspector.go b/inspector.go index eaa2f15..adfaac5 100644 --- a/inspector.go +++ b/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) +}