You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

23 lines
474 B

--[[
Removes a repeatable job
Input:
KEYS[1] repeat jobs key
KEYS[2] delayed jobs key
ARGV[1] repeat job id
ARGV[2] repeat job key
ARGV[3] queue key
]]
local millis = redis.call("ZSCORE", KEYS[1], ARGV[2])
if(millis) then
-- Delete next programmed job.
local repeatJobId = ARGV[1] .. millis
if(redis.call("ZREM", KEYS[2], repeatJobId) == 1) then
redis.call("DEL", ARGV[3] .. repeatJobId)
end
end
redis.call("ZREM", KEYS[1], ARGV[2]);