2
0
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:
Ken Hibino
2021-04-01 16:55:57 -07:00
parent f0c12cc6e3
commit 5c6068c78b
5 changed files with 80 additions and 61 deletions

View File

@@ -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
}