Skip to content
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

Option for unlimited number of extensions for a Redlock instance. #692

Open
btemplep opened this issue Jul 2, 2022 · 0 comments
Open

Option for unlimited number of extensions for a Redlock instance. #692

btemplep opened this issue Jul 2, 2022 · 0 comments

Comments

@btemplep
Copy link

btemplep commented Jul 2, 2022

Is your feature request related to a problem? Please describe.
There is a case I have when using a Redlock, where I would like to have an unlimited number of extensions.
You can currently set the maximum number of extensions when creating a Redlock with the num_extensions,
but this cannot be set to unlimited.

Describe the solution you'd like
Following the other conventions, setting num_extensions to -1 for unlimited would work.

my_lock = Redlock(
    key="my_key",
    masters={my_master},
    num_extensions=-1 # Allow unlimited calls to my_lock.extend()
)

Describe alternatives you've considered
You can set an arbitrarily large int for num_extensions but it's not as clean.

Additional context
N/A

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant