lantins / resque-lock-timeout

A Resque plugin; adds locking, with optional timeout/deadlock handling to resque jobs.
MIT License
53 stars 20 forks source link

This commit allows one to override the redis connection used to store the locks #6

Closed richievos closed 13 years ago

richievos commented 13 years ago

The big win is this lets you easily pick which redis server the locks are written to. In particular, if you have a setup where specific jobs go to specific redises, this makes it much easier to keep the locks with those workers.

It also has the side effect of allowing you to not namespace the lock names if you desire them not to be, since you don't have to use a Redis::Namespace for storing the locks.

I've added a test and updated the readme accordingly.

Please let me know if you have any issues with this, otherwise it'd be awesome if we could get a new version of the gem released with this patch. I'm about to monkey patch this into our rails app (groupon.com), but would prefer that to be short-lived.

lantins commented 13 years ago

Hey Richie,

Thanks for the pull request with a test and README update! =)

All looks good at first glance, I'll test here and apply if its all good today.

Thanks again.

richievos commented 13 years ago

Let me know if there's anything I can do.

lantins commented 13 years ago

Sorry for the delay! Got an afternoon to go through this kinda stuff. Will have a new gem cut shortly =)

Thanks again!

richievos commented 13 years ago

Sorry, for clarification, there's not a new version of the gem with this pushed out yet?

lantins commented 13 years ago

I pushed two new gems on the 16th

v0.3.0 includes your changes, v0.3.1 included changes from another fork.

Please let me know if you bump into any issues =)

richievos commented 13 years ago

Awesome, thanks!

lantins commented 13 years ago

Pleasure =)