MCPcopy Index your code
hub / github.com/simstudioai/sim / extendLock

Function extendLock

apps/sim/lib/core/config/redis.ts:268–280  ·  view source on GitHub ↗
(
  lockKey: string,
  value: string,
  expirySeconds: number
)

Source from the content-addressed store, hash-verified

266 * Redis never held a real lock, so heartbeat success is implicit.
267 */
268export async function extendLock(
269 lockKey: string,
270 value: string,
271 expirySeconds: number
272): Promise<boolean> {
273 const redis = getRedisClient()
274 if (!redis) {
275 return true
276 }
277
278 const result = await redis.eval(EXTEND_LOCK_SCRIPT, 1, lockKey, value, expirySeconds)
279 return result === 1
280}
281
282/**
283 * Close the Redis connection.

Callers 4

redis.test.tsFile · 0.90
startAbortPollerFunction · 0.90
withCascadeLockFunction · 0.90
runWithRedisMutexFunction · 0.90

Calls 1

getRedisClientFunction · 0.85

Tested by

no test coverage detected