MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / cleanupLockfile

Method cleanupLockfile

src/mcp/daemon.ts:500–512  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

498 }
499
500 private cleanupLockfile(): void {
501 try {
502 if (fs.existsSync(this.pidPath)) {
503 // Only remove if it still belongs to us — another daemon may have
504 // already taken over while we were shutting down (extremely rare).
505 const raw = fs.readFileSync(this.pidPath, 'utf8');
506 const info = decodeLockInfo(raw);
507 if (info && info.pid === process.pid) {
508 fs.unlinkSync(this.pidPath);
509 }
510 }
511 } catch { /* best-effort; we're exiting anyway */ }
512 }
513}
514
515/**

Callers 2

startMethod · 0.95
stopMethod · 0.95

Calls 1

decodeLockInfoFunction · 0.90

Tested by

no test coverage detected