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

Function releaseLock

apps/sim/lib/core/config/redis.ts:249–257  ·  view source on GitHub ↗
(lockKey: string, value: string)

Source from the content-addressed store, hash-verified

247 * When Redis is not available, returns true (no-op) since no lock was held.
248 */
249export async function releaseLock(lockKey: string, value: string): Promise<boolean> {
250 const redis = getRedisClient()
251 if (!redis) {
252 return true // No-op when Redis unavailable; no lock was actually held
253 }
254
255 const result = await redis.eval(RELEASE_LOCK_SCRIPT, 1, lockKey, value)
256 return result === 1
257}
258
259/**
260 * Extend the TTL of a distributed lock if still owned by the caller.

Callers 9

releasePendingChatStreamFunction · 0.90
withCascadeLockFunction · 0.90
runWithRedisMutexFunction · 0.90
withLeaderLockFunction · 0.90
route.tsFile · 0.90
route.tsFile · 0.90
route.tsFile · 0.90
route.tsFile · 0.90
route.tsFile · 0.90

Calls 1

getRedisClientFunction · 0.85

Tested by

no test coverage detected