-
Notifications
You must be signed in to change notification settings - Fork 78
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
Customizable prefix #101
Comments
You could subclass and do something like: class PrefixedLock(Lock):
def __init__(self, redis_client, prefix, name, **kwargs):
super().__init__(redis_client, name, **kwargs)
self._name = f'{prefix}:lock:{name}'
self._signal = f'{prefix}:lock-signal:{name}' |
Yep. But it looks like a dirty solution.
And it all looks like I want to hack python-redis-lock |
Perhaps a key template argument could be added through all the clases/functions. Eg: Lock(key_template={'lock': 'lock:{}', 'signal': 'lock-signal:{}'})
reset_all(key_template={'lock': 'lock:{}', 'signal': 'lock-signal:{}'}) But I do want to switch to redis functions (redis>=7) for the next release if I get to do one, so there's that... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi. Faced with something similar to #10
I have shared Redis cache, and control access with ACL.
To separate instances I use prefixes but python-redis-lock overwrites my prefix with
lock:
python-redis-lock/src/redis_lock/__init__.py
Line 162 in 1497012
So I get an access error:
Could we have a customizable prefix for this case?
The text was updated successfully, but these errors were encountered: