2
0
mirror of https://github.com/hibiken/asynq.git synced 2025-10-23 10:16:12 +08:00

Add DeleteQueue method to Inspector

- Added ErrQueueNotFound and ErrQueueNotEmpty type to indicate the kind
  of an error returned from the method.
This commit is contained in:
Ken Hibino
2020-11-27 22:27:54 -08:00
parent c4dc993241
commit 55f197d230
4 changed files with 259 additions and 20 deletions

View File

@@ -745,7 +745,6 @@ func (r *RDB) RemoveQueue(qname string, force bool) error {
return err
}
}
return r.client.SRem(base.AllQueues, qname).Err()
}

View File

@@ -2707,10 +2707,10 @@ func TestRemoveQueue(t *testing.T) {
err := r.RemoveQueue(tc.qname, tc.force)
if err != nil {
t.Errorf("(*RDB).RemoveQueue(%q) = %v, want nil", tc.qname, err)
t.Errorf("(*RDB).RemoveQueue(%q, %t) = %v, want nil",
tc.qname, tc.force, err)
continue
}
if r.client.SIsMember(base.AllQueues, tc.qname).Val() {
t.Errorf("%q is a member of %q", tc.qname, base.AllQueues)
}