MCPcopy Index your code
hub / github.com/codeaashu/claude-code / getAllLockInfo

Function getAllLockInfo

src/utils/nativeInstaller/pidLock.ts:352–384  ·  view source on GitHub ↗
(locksDir: string)

Source from the content-addressed store, hash-verified

350 * Get information about all version locks for diagnostics
351 */
352export function getAllLockInfo(locksDir: string): LockInfo[] {
353 const fs = getFsImplementation()
354 const lockInfos: LockInfo[] = []
355
356 try {
357 const lockFiles = fs
358 .readdirStringSync(locksDir)
359 .filter((f: string) => f.endsWith('.lock'))
360
361 for (const lockFile of lockFiles) {
362 const lockFilePath = join(locksDir, lockFile)
363 const content = readLockContent(lockFilePath)
364
365 if (content) {
366 lockInfos.push({
367 version: content.version,
368 pid: content.pid,
369 isProcessRunning: isProcessRunning(content.pid),
370 execPath: content.execPath,
371 acquiredAt: new Date(content.acquiredAt),
372 lockFilePath,
373 })
374 }
375 }
376 } catch (error) {
377 if (isENOENT(error)) {
378 return lockInfos
379 }
380 logError(toError(error))
381 }
382
383 return lockInfos
384}
385
386/**
387 * Clean up stale locks (locks where the process is no longer running)

Callers 1

DoctorFunction · 0.85

Calls 7

getFsImplementationFunction · 0.85
readLockContentFunction · 0.85
isENOENTFunction · 0.85
toErrorFunction · 0.85
isProcessRunningFunction · 0.70
logErrorFunction · 0.50
pushMethod · 0.45

Tested by

no test coverage detected