diff options
Diffstat (limited to 'redis/asyncio/lock.py')
-rw-r--r-- | redis/asyncio/lock.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/redis/asyncio/lock.py b/redis/asyncio/lock.py index 2f78d69..e1d11a8 100644 --- a/redis/asyncio/lock.py +++ b/redis/asyncio/lock.py @@ -201,14 +201,14 @@ class Lock: blocking_timeout = self.blocking_timeout stop_trying_at = None if blocking_timeout is not None: - stop_trying_at = asyncio.get_event_loop().time() + blocking_timeout + stop_trying_at = asyncio.get_running_loop().time() + blocking_timeout while True: if await self.do_acquire(token): self.local.token = token return True if not blocking: return False - next_try_at = asyncio.get_event_loop().time() + sleep + next_try_at = asyncio.get_running_loop().time() + sleep if stop_trying_at is not None and next_try_at > stop_trying_at: return False await asyncio.sleep(sleep) |