MCPcopy
hub / github.com/redis/redis-py / do_extend

Method do_extend

redis/asyncio/lock.py:315–325  ·  view source on GitHub ↗
(self, additional_time, replace_ttl)

Source from the content-addressed store, hash-verified

313 return self.do_extend(additional_time, replace_ttl)
314
315 async def do_extend(self, additional_time, replace_ttl) -> Literal[True]:
316 additional_time = int(additional_time * 1000)
317 if not bool(
318 await self.lua_extend(
319 keys=[self.name],
320 args=[self.local.token, additional_time, replace_ttl and "1" or "0"],
321 client=self.redis,
322 )
323 ):
324 raise LockNotOwnedError("Cannot extend a lock that's no longer owned")
325 return True
326
327 def reacquire(self) -> Awaitable[Literal[True]]:
328 """

Callers 1

extendMethod · 0.95

Calls 1

LockNotOwnedErrorClass · 0.90

Tested by

no test coverage detected