mirror of
https://github.com/hibiken/asynq.git
synced 2025-09-19 13:21:58 +08:00
Inspector support Go context
This commit is contained in:
@@ -1291,12 +1291,7 @@ return res
|
||||
`)
|
||||
|
||||
// ListLeaseExpired returns a list of task messages with an expired lease from the given queues.
|
||||
func (r *RDB) ListLeaseExpired(cutoff time.Time, qnames ...string) ([]*base.TaskMessage, error) {
|
||||
return r.ListLeaseExpiredContext(context.Background(), cutoff, qnames...)
|
||||
}
|
||||
|
||||
// ListLeaseExpiredContext returns a list of task messages with an expired lease from the given queues.
|
||||
func (r *RDB) ListLeaseExpiredContext(ctx context.Context, cutoff time.Time, qnames ...string) ([]*base.TaskMessage, error) {
|
||||
func (r *RDB) ListLeaseExpired(ctx context.Context, cutoff time.Time, qnames ...string) ([]*base.TaskMessage, error) {
|
||||
var op errors.Op = "rdb.ListLeaseExpired"
|
||||
var msgs []*base.TaskMessage
|
||||
for _, qname := range qnames {
|
||||
|
@@ -2630,7 +2630,7 @@ func TestListLeaseExpired(t *testing.T) {
|
||||
h.FlushDB(t, r.client)
|
||||
h.SeedAllLease(t, r.client, tc.lease)
|
||||
|
||||
got, err := r.ListLeaseExpired(tc.cutoff, tc.qnames...)
|
||||
got, err := r.ListLeaseExpired(context.Background(), tc.cutoff, tc.qnames...)
|
||||
if err != nil {
|
||||
t.Errorf("%s; ListLeaseExpired(%v) returned error: %v", tc.desc, tc.cutoff, err)
|
||||
continue
|
||||
|
Reference in New Issue
Block a user