aioredis-lock
aioredis-lock copied to clipboard
lock.is_owner() does not work
Looking at the cause for this. await self.pool_or_conn.get(self.key) returns a string and self._token.encode() is a b''
The fix is to drop the .encode() i.e new code is. async def is_owner(self) -> bool: """Determine if the instance is the owner of the lock""" return ( await self.pool_or_conn.get(self.key) ) == self._token # pylint: disable=no-member