We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
import asyncio from aredis import StrictRedis from aredis.lock import Lock async def main(): redis = StrictRedis(host='127.0.0.1', port=6379, db=0, encoding="utf8", decode_responses=True) async with Lock(redis=redis, name="XXX", timeout=5, blocking=False): redis.hset("aaa", "xxx") await asyncio.sleep(0.25) if __name__ == '__main__': asyncio.run(main())
The text was updated successfully, but these errors were encountered:
async def do_release(self, expected_token): name = self.name async def execute_release(pipe): lock_value = await pipe.get(name) if lock_value != expected_token: raise LockError("Cannot release a lock that's no longer owned") await pipe.delete(name) await self.redis.transaction(execute_release, name)
seems it is because of lock_value was decode, but expected_token was bytes
Sorry, something went wrong.
No branches or pull requests
The text was updated successfully, but these errors were encountered: