locks: handle refresh thread already started
This commit is contained in:
parent
f1f1c99cae
commit
d811485440
1 changed files with 3 additions and 0 deletions
|
|
@ -341,6 +341,9 @@ def get_mutex_lock(client, lock_key, lock_timeout, auto_renewal=False):
|
|||
return self.lock.acquire(wait)
|
||||
except redis_lock.AlreadyAcquired:
|
||||
return False
|
||||
except redis_lock.AlreadyStarted:
|
||||
# refresh thread exists, but it also means we acquired the lock
|
||||
return True
|
||||
|
||||
def release(self):
|
||||
try:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue