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

Function isProcessAlive

src/mcp/daemon.ts:843–852  ·  view source on GitHub ↗
(pid: number)

Source from the content-addressed store, hash-verified

841 * mistake a live daemon for a dead one and clear its lock.
842 */
843export function isProcessAlive(pid: number): boolean {
844 try {
845 process.kill(pid, 0);
846 return true;
847 } catch (err: unknown) {
848 const e = err as NodeJS.ErrnoException;
849 if (e.code === 'EPERM') return true; // exists, just not ours to signal
850 return false;
851 }
852}
853
854/**
855 * The one `listen()` error we must NOT relocate past. EADDRINUSE means the path

Callers 4

makeFallbackEngineFunction · 0.90
outwaitCandidateFunction · 0.90
startDaemonProcessMethod · 0.90
clearStaleDaemonLockFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected