2
0
mirror of https://github.com/hibiken/asynq.git synced 2025-10-23 10:16:12 +08:00

Update RDB.Schedule with task state

This commit is contained in:
Ken Hibino
2021-04-24 06:44:44 -07:00
parent f7954c2683
commit 2a1fbf6fa5
2 changed files with 47 additions and 12 deletions

View File

@@ -333,7 +333,11 @@ func (r *RDB) Requeue(msg *base.TaskMessage) error {
// ARGV[4] -> task timeout in seconds (0 if not timeout)
// ARGV[5] -> task deadline in unix time (0 if no deadline)
var scheduleCmd = redis.NewScript(`
redis.call("HSET", KEYS[1], "msg", ARGV[1], "timeout", ARGV[4], "deadline", ARGV[5])
redis.call("HSET", KEYS[1],
"msg", ARGV[1],
"state", "scheduled",
"timeout", ARGV[4],
"deadline", ARGV[5])
redis.call("ZADD", KEYS[2], ARGV[2], ARGV[3])
return 1
`)