-
Notifications
You must be signed in to change notification settings - Fork 166
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
Documentation clarification on extend()
#26
Comments
extend()
Hi @bradvogel - this is a really good point; I guess there are actually 3 possibilities that could be true given the ambiguity of the name "extend": 1. it could extend the lock to X ms from "now" Currently, it behaves like option 1 above, although I could definitely see the utility of option 2. Just out of curiosity, do you have a use case that would favor option 2? Or is the lack of clarity your primary concern here? |
The documentation seems to imply that
extend()
will extend the current timeout by X ms. So I'd think this would extend the lock to 15sec:But
extend()
appears to only overwrite the ttl, so it's only 5sec in the above example. This should be clarified in the docs, orextend()
should be renamedttl()
since it's just resetting the ttl to a new value.The text was updated successfully, but these errors were encountered: