MCPcopy Create free account
hub / github.com/Dispatcharr/Dispatcharr / refresh

Method refresh

dispatcharr/persistent_lock.py:45–55  ·  view source on GitHub ↗

Refresh the lock's expiration time if this instance owns the lock. Returns True if the expiration was successfully extended.

(self)

Source from the content-addressed store, hash-verified

43 return result is not None
44
45 def refresh(self) -> bool:
46 """
47 Refresh the lock's expiration time if this instance owns the lock.
48 Returns True if the expiration was successfully extended.
49 """
50 current_value = self.redis_client.get(self.lock_key)
51 if current_value and current_value == self.lock_token:
52 self.redis_client.expire(self.lock_key, self.lock_timeout)
53 self.has_lock = False
54 return True
55 return False
56
57 def release(self) -> bool:
58 """

Callers 1

persistent_lock.pyFile · 0.80

Calls 2

expireMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected