-
Notifications
You must be signed in to change notification settings - Fork 80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Lock extension via lock method allows extending expired locks #36
Comments
I just submitted pull request #37 to add extend functionality. Let me know if you need anything else! |
Well, not quite. It lets you extend a lock that has been expired. Consider this script:
Note that the line |
you got a point |
Add extend functionality to fix issue #36
Hi Leandro, Thanks for taking my pull request for lock extensions!
|
This is something we already discussed @maltoe but maybe for Ruby-1-9 is reasonable. What do you think @maltoe ? Ruby-1-9 is 6 years old too! |
Yes, 1.9.3 is quite old, but lots of people are stuck on it for various reasons. I found that this gem's incompatibility with 1.9.3 is just a couple of uses of keyword parameters and a |
I'm okay @jonp :) |
@jonp @leandromoreira i contributed the lock functionality and this is an error on my part:
i would prefer that the original extend functionality be fixed instead of adding another complete, but slightly different implementation |
@seamusabshere that works for me, although there may be some users that now expect the existing semantics. |
Great idea! Cool Thank you so much @seamusabshere 🍻 |
* Remove Client#extend_life and #extend_life! methods, offer an additional extend_life option for Client#lock instead. * Pass options hash down the line to try_lock_instances, only there decide which script to use, etc. * Fix specs and testing helper. Fixes #36.
If your code allows the lock to expire and then you call
lock
to extend the life of the lock, it will allow it. It would be really handy to have it fail if the lock was allowed to expire. This has been added to the node and .NET versions of the algorithm, so there's some precedent.The text was updated successfully, but these errors were encountered: