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

Update RDB.EnqueueUnique with task state

This commit is contained in:
Ken Hibino
2021-04-19 06:28:58 -07:00
parent a352ee2fa2
commit f7954c2683
2 changed files with 37 additions and 7 deletions

View File

@@ -99,7 +99,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[3], "timeout", ARGV[4], "deadline", ARGV[5])
redis.call("HSET", KEYS[2],
"msg", ARGV[3],
"state", "pending",
"timeout", ARGV[4],
"deadline", ARGV[5])
redis.call("LPUSH", KEYS[3], ARGV[1])
return 1
`)