resque-lock
resque-lock copied to clipboard
A Resque plugin for ensuring only one instance of your job is running at a time.
I see this strange behavior occasionally, but often enough to want to find a fix. I'll en-queue some jobs. I can see the keys for the locks in the redis...
It is good to know about timeout in advance. :)
If no workers pull the lock-holding job from the queue, additional jobs are able to be queued after the lock timeout expires. If we're about to expire the lock, ensure...
This is useful when you know that the currently running job might not be taking into account the most recent updates to some of the data it is operating on,...
Otherwise, the before_enqueue_lock will create a different redis key than around_perform_lock deletes. This can be tested by using a symbol in the arguments, which gets encoded as a string. A...
When some arguments types are used (eg Symbols), the lock mechanism fails to calculate the same lock key in the client (before queue) and in the job (around perform). This...
Unlocks a queue when dequeue is called, using the before dequeue hook (see: https://github.com/humancopy/resque/commit/5042244f486b8ee976926f4b4007de182718f0ef). It also stores the lock in a hash so it's easier to remove all locks if...
It would be nice to have a callback so that when a job is skipped because of a lock, you can reschedule it or do whatever processing is needed. I...
Even with `Resque.inline = true`, locking is still getting triggered, which means that in my tests Resque is trying to hit Redis, which I don't want it to do. I'd...