resque-loner icon indicating copy to clipboard operation
resque-loner copied to clipboard

resque loner thinks job is queued when queue is empty

Open michaelglass opened this issue 10 years ago • 2 comments

I'm using

gem 'resque-retry', git: 'https://github.com/lantins/resque-retry.git', ref: '9314b34d543bc87668fd6107148fd1c8dd7d61a2'
gem 'resque-pool'
gem 'resque-multi-job-forks'

if I check for a job that's already been queued, but completed, it says that it's already enqueued.

halp!

michaelglass avatar Aug 27 '14 01:08 michaelglass

Ran into the same issue. Any quick fix for this?

ejfinneran avatar May 19 '15 22:05 ejfinneran

The issue we ran into was I nuked the whole queue so all the lock keys where still around. The fix was:

key = 'resque:loners:queue:queue_name:job'
user_ids.map {|id| $redis.del(key + ":" + UserJob.redis_key(:class => 'UserJob', :args => [id]))}

We also started setting a TTL so that it will clean itself up after a number of hours: https://github.com/resque/resque-loner/blob/master/lib/resque-loner/unique_job.rb#L36-L48

ejfinneran avatar May 20 '15 20:05 ejfinneran