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

Update RDB.ScheduleUnique with task state

This commit is contained in:
Ken Hibino
2021-04-24 20:41:44 -07:00
parent 2a1fbf6fa5
commit e4dd39d814
2 changed files with 49 additions and 12 deletions

View File

@@ -379,7 +379,11 @@ local ok = redis.call("SET", KEYS[1], ARGV[1], "NX", "EX", ARGV[2])
if not ok then
return 0
end
redis.call("HSET", KEYS[2], "msg", ARGV[4], "timeout", ARGV[5], "deadline", ARGV[6])
redis.call("HSET", KEYS[2],
"msg", ARGV[4],
"state", "scheduled",
"timeout", ARGV[5],
"deadline", ARGV[6])
redis.call("ZADD", KEYS[3], ARGV[3], ARGV[1])
return 1
`)