diff options
author | Andy McCurdy <andy@andymccurdy.com> | 2014-06-18 21:44:10 -0400 |
---|---|---|
committer | Andy McCurdy <andy@andymccurdy.com> | 2014-06-18 21:44:10 -0400 |
commit | bd28b48b143e736c672b90561175e85e6223c86c (patch) | |
tree | f8774ecda27b22058092f8b1b6b0ad1e084be7e4 | |
parent | ff2f3567addabb723ed9a9bd0f739fa81910d88a (diff) | |
parent | d6120ead00fbe68262bbef1bdbfce8d4739e8756 (diff) | |
download | redis-py-bd28b48b143e736c672b90561175e85e6223c86c.tar.gz |
Merge pull request #499 from grantcox/master
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 |