locks: handle refresh thread already started

This commit is contained in:
RhodeCode Admin 2021-07-27 10:08:28 +02:00
parent f1f1c99cae
commit d811485440

View file

@ -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: