-
Notifications
You must be signed in to change notification settings - Fork 48
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
What does this todo mean? #46
Comments
For now aioredlock doesn't track locks on redis, as soon as the lock becomes valid it will be valid forever even when it will expire on server side. Periodically lock checking/extension could be implemented in aioredlock, but someone have to do it. This is how it could be done async def __expire_setter(self):
key_expire = self.hub_config['key_expire'] # lock lifetime
while True:
if self.__locks: # dict as {lock.id(): lock}
log().debug('Extending locks: %s',
', '.join(f'{l.resource}(id:{l.id})'
for l in self.__locks.values()))
await asyncio.gather(*(l.extend()
for l in self.__locks.values()))
await asyncio.sleep(key_expire / 2) Also aioredlock/aioredlock/algorithm.py Line 139 in 6c62f08
|
"Expire the lock valid attribute according to the lock validity in a safe way if possible."
I don't understand what this means? Does it mean that a lock is valid even if it's released or got into timeout?
The text was updated successfully, but these errors were encountered: