mirror of
https://github.com/hibiken/asynq.git
synced 2025-10-24 22:46:11 +08:00
Update RDB.ListScheduled, ListRetry, and ListArchived to return list of
TaskInfo
This commit is contained in:
@@ -344,6 +344,8 @@ func seedRedisZSet(tb testing.TB, c redis.UniversalClient, qname string, items [
|
||||
key = base.RetryKey(qname)
|
||||
case stateArchived:
|
||||
key = base.ArchivedKey(qname)
|
||||
case stateActive:
|
||||
key = base.DeadlinesKey(qname)
|
||||
default:
|
||||
tb.Fatalf("cannot seed redis ZSET with task state %s", state)
|
||||
}
|
||||
@@ -362,9 +364,13 @@ func seedRedisZSet(tb testing.TB, c redis.UniversalClient, qname string, items [
|
||||
processAt int64
|
||||
lastFailedAt int64
|
||||
)
|
||||
if state == stateScheduled || state == stateRetry {
|
||||
if state == stateScheduled {
|
||||
processAt = item.Score
|
||||
}
|
||||
if state == stateRetry {
|
||||
processAt = item.Score
|
||||
lastFailedAt = time.Now().Unix()
|
||||
}
|
||||
if state == stateArchived {
|
||||
lastFailedAt = item.Score
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user