Commit 99b26062 authored by Daniel Scheffler's avatar Daniel Scheffler
Browse files

Added expiration to redis lock.

parent 2fe80988
......@@ -145,7 +145,7 @@ class MemoryReserver(Semaphore):
def acquire(self, timeout=0, target=None):
if not self.disabled:
with Lock(self.client, 'GMS_mem_acquire_lock'):
with Lock(self.client, 'GMS_mem_acquire_lock', expire=5, auto_renewal=True):
if self.usable_memory_gb >= self.mem2lock_gb:
for i in range(self.mem2lock_gb):
token = super(MemoryReserver, self).acquire(timeout=timeout)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment