2
0
mirror of https://github.com/hibiken/asynq.git synced 2025-08-19 15:08:55 +08:00

Update RDB.Dequeue to return message and deadline

This commit is contained in:
Ken Hibino
2020-06-18 05:45:10 -07:00
parent 6cc5bafaba
commit 9b05dea394
4 changed files with 83 additions and 50 deletions

View File

@@ -60,11 +60,11 @@ func (tb *TestBroker) EnqueueUnique(msg *base.TaskMessage, ttl time.Duration) er
return tb.real.EnqueueUnique(msg, ttl)
}
func (tb *TestBroker) Dequeue(qnames ...string) (*base.TaskMessage, error) {
func (tb *TestBroker) Dequeue(qnames ...string) (*base.TaskMessage, int, error) {
tb.mu.Lock()
defer tb.mu.Unlock()
if tb.sleeping {
return nil, errRedisDown
return nil, 0, errRedisDown
}
return tb.real.Dequeue(qnames...)
}