Skip to content

Commit 68ed598

Browse files
committed
docs
1 parent 63bf595 commit 68ed598

File tree

1 file changed

+9
-0
lines changed
  • packages/service-library/src/servicelib/redis

1 file changed

+9
-0
lines changed

packages/service-library/src/servicelib/redis/_utils.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,15 @@
1212

1313

1414
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+
"""
1524
try:
1625
with log_context(_logger, logging.DEBUG, f"Autoextend lock {lock.name!r}"):
1726
await lock.reacquire()

0 commit comments

Comments
 (0)