From d6120ead00fbe68262bbef1bdbfce8d4739e8756 Mon Sep 17 00:00:00 2001 From: Grant Cox Date: Thu, 19 Jun 2014 11:30:19 +1000 Subject: [PATCH] Lock.acquire() to respect blocking_timeout argument --- redis/lock.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/redis/lock.py b/redis/lock.py index eea6c8b733..90f0e7af30 100644 --- a/redis/lock.py +++ b/redis/lock.py @@ -105,8 +105,8 @@ def acquire(self, blocking=None, blocking_timeout=None): if blocking_timeout is None: blocking_timeout = self.blocking_timeout stop_trying_at = None - if self.blocking_timeout is not None: - stop_trying_at = mod_time.time() + self.blocking_timeout + if blocking_timeout is not None: + stop_trying_at = mod_time.time() + blocking_timeout while 1: if self.do_acquire(token): self.local.token = token