jayniz/resque-loner — pull request #15 by unclebilly (2011-12-12 20:40:50+00:00)
Title: Configurable TTL for lock keys

Hey -
Thanks a ton for this gem - it works very well and it is easy to understand and work with.

I have a project where there is a job that is super-critical, run on minute-by-minute schedule, and cannot be run concurrently. I ran into an issue where a job key disappeared but the locking key did not (an issue caused by something outside of resque-loner), thus preventing the job from being rescheduled. I've made a patch that puts the locking key's TTL in a class method on the job (and included a test and comments). This will allow me to say "for SuperCriticalJob, I want the lock to be in place for only 5 minutes."
I hope you find it useful.
Cheers,
Billy Reisinger