MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / getLiveLock

Function getLiveLock

packages/server/src/lock.ts:154–158  ·  view source on GitHub ↗
(lockPath: string = DEFAULT_LOCK_PATH)

Source from the content-addressed store, hash-verified

152 * is no daemon to reuse. Read-only: never mutates the lock.
153 */
154export function getLiveLock(lockPath: string = DEFAULT_LOCK_PATH): LockContents | undefined {
155 const contents = readLockContents(lockPath);
156 if (!contents) return undefined;
157 return pidAlive(contents.pid) ? contents : undefined;
158}
159
160/**
161 * Try `O_WRONLY | O_CREAT | O_EXCL` to create the lock file with the contents.

Callers 4

lock.test.tsFile · 0.90
ensureDaemonFunction · 0.90
handlePsCommandFunction · 0.90

Calls 2

readLockContentsFunction · 0.85
pidAliveFunction · 0.70

Tested by

no test coverage detected