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

Function waitForDeath

src/mcp/daemon-registry.ts:133–140  ·  view source on GitHub ↗
(pid: number, timeoutMs: number)

Source from the content-addressed store, hash-verified

131const sleep = (ms: number): Promise<void> => new Promise((r) => setTimeout(r, ms));
132
133async function waitForDeath(pid: number, timeoutMs: number): Promise<boolean> {
134 const deadline = Date.now() + timeoutMs;
135 while (Date.now() < deadline) {
136 if (!isProcessAlive(pid)) return true;
137 await sleep(100);
138 }
139 return !isProcessAlive(pid);
140}
141
142export interface StopResult {
143 root: string;

Callers 1

stopDaemonAtFunction · 0.85

Calls 2

isProcessAliveFunction · 0.70
sleepFunction · 0.70

Tested by

no test coverage detected