MCPcopy Create free account
hub / github.com/AnukarOP/claude-code-leaked / getAllLockInfo

Function getAllLockInfo

source code/utils/nativeInstaller/pidLock.ts:354–386  ·  view source on GitHub ↗
(locksDir: string)

Source from the content-addressed store, hash-verified

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

Callers 1

DoctorFunction · 0.85

Calls 6

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

Tested by

no test coverage detected