We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 63bf595 commit 68ed598Copy full SHA for 68ed598
packages/service-library/src/servicelib/redis/_utils.py
@@ -12,6 +12,15 @@
12
13
14
async def auto_extend_lock(lock: Lock) -> None:
15
+ """automatically extend a distributed lock TTL (time to live) by re-acquiring the lock
16
+
17
+ Arguments:
18
+ lock -- the lock to auto-extend
19
20
+ Raises:
21
+ LockLostError: in case the lock is not available anymore
22
+ LockError: in case of wrong usage (no timeout or lock was not previously acquired)
23
+ """
24
try:
25
with log_context(_logger, logging.DEBUG, f"Autoextend lock {lock.name!r}"):
26
await lock.reacquire()
0 commit comments