Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Bug fix. When calling 'recur on' with a specific jid, but to

a different queue than it was originally put in for, it was causing some
vestigial data to be saved in the old queue. Now this is effectively the
same as a 'move'
  • Loading branch information...
commit 534fac347c245a9a62100586e8ed662039ec6584 1 parent bea9915
Dan Lecocq authored
Showing with 8 additions and 1 deletion.
  1. +8 −1 recur.lua
View
9 recur.lua
@@ -35,7 +35,14 @@ if command == 'on' then
options.priority = assert(tonumber(options.priority or 0) , 'Recur(): Arg "priority" must be a number. Got: ' .. tostring(options.priority))
options.retries = assert(tonumber(options.retries or 0) , 'Recur(): Arg "retries" must be a number. Got: ' .. tostring(options.retries))
- local count = redis.call('hget', 'ql:r:' .. jid, 'count') or 0
+ local count, old_queue = unpack(redis.call('hmget', 'ql:r:' .. jid, 'count', 'queue'))
+ count = count or 0
+
+ -- If it has previously been in another queue, then we should remove
+ -- some information about it
+ if old_queue then
+ redis.call('zrem', 'ql:q:' .. old_queue .. '-recur', jid)
+ end
-- Do some insertions
redis.call('hmset', 'ql:r:' .. jid,
Please sign in to comment.
Something went wrong with that request. Please try again.