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 to remove key prefix for Redlock #743

Open
lauraguilevy opened this issue Apr 29, 2024 · 0 comments
Open

Option to remove key prefix for Redlock #743

lauraguilevy opened this issue Apr 29, 2024 · 0 comments

Comments

@lauraguilevy
Copy link

In the current version of your code, the prefix "redlock:" is systematically added to any Redlock lock key created with:

object_lock = Redlock(key=lock_key, masters={redis_1, redis_2, redis_3}, auto_release_time=20)

This imposes a constraint on other programs using the lock key to coordinate access to a resource, namely to use the same prefix in front of the key. This is very inconvenient since existing code needs to be changed to adapt to this requirement.

Moreover, the use of the prefix is not documented (I discovered it by looking at the content of the Redis servers).

Is there a way to use the Redlock without imposing a specific prefix? Ideally, if a prefix is added, it should be a parameter when creating the Redlock object.

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