2
0
mirror of https://github.com/hibiken/asynq.git synced 2026-02-03 15:04:55 +00:00

Add task message to deadlines set on dequeue

Updated dequeueCmd to decode the message and compute its deadline and add
the message to the Deadline set.
This commit is contained in:
Ken Hibino
2020-06-17 06:46:54 -07:00
parent 716d3d987e
commit 6cc5bafaba
3 changed files with 89 additions and 13 deletions

View File

@@ -259,6 +259,12 @@ func GetDeadEntries(tb testing.TB, r *redis.Client) []ZSetEntry {
return getZSetEntries(tb, r, base.DeadQueue)
}
// GetDeadlinesEntries returns all task messages and its score in the deadlines set.
func GetDeadlinesEntries(tb testing.TB, r *redis.Client) []ZSetEntry {
tb.Helper()
return getZSetEntries(tb, r, base.KeyDeadlines)
}
func getListMessages(tb testing.TB, r *redis.Client, list string) []*base.TaskMessage {
data := r.LRange(list, 0, -1).Val()
return MustUnmarshalSlice(tb, data)