diff options
author | Grant Cox <grant@avaaz.org> | 2014-06-19 11:30:19 +1000 |
---|---|---|
committer | Grant Cox <grant@avaaz.org> | 2014-06-19 11:36:04 +1000 |
commit | d6120ead00fbe68262bbef1bdbfce8d4739e8756 (patch) | |
tree | f8774ecda27b22058092f8b1b6b0ad1e084be7e4 | |
parent | ff2f3567addabb723ed9a9bd0f739fa81910d88a (diff) | |
download | redis-py-d6120ead00fbe68262bbef1bdbfce8d4739e8756.tar.gz |
Lock.acquire() to respect blocking_timeout argument
-rw-r--r-- | redis/lock.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/redis/lock.py b/redis/lock.py index eea6c8b..90f0e7a 100644 --- a/redis/lock.py +++ b/redis/lock.py @@ -105,8 +105,8 @@ class Lock(object): 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 |