Skip to content

Commit

Permalink
fix: fixed reprocess lua script
Browse files Browse the repository at this point in the history
  • Loading branch information
manast committed Aug 24, 2019
1 parent a3f6148 commit b78296f
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/commands/reprocessJob-4.lua
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,11 @@
Events:
emits 'added' if succesfully moved job to wait.
]]
if (redis.call("EXISTS", KEYS[1]) == 1) then
if (redis.call("ZREM", KEYS[3], ARGV[1]) == 1) then
redis.call(ARGV[2], KEYS[4], ARGV[1])
redis.call(ARGV[2], KEYS[4] .. ":added", ARGV[1])
local rcall = redis.call;
if (rcall("EXISTS", KEYS[1]) == 1) then
if (rcall("ZREM", KEYS[3], ARGV[1]) == 1) then
rcall(ARGV[2], KEYS[4], ARGV[1])
rcall(ARGV[2], KEYS[4] .. ":added", ARGV[1])

-- Emit waiting event
rcall("XADD", KEYS[2], "*", "event", "waiting", "jobId", jobId);
Expand Down

0 comments on commit b78296f

Please sign in to comment.