MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / waitUntilStopped

Function waitUntilStopped

e2e/local/daemon-process.ts:28–35  ·  view source on GitHub ↗
(pid: number, timeoutMs: number)

Source from the content-addressed store, hash-verified

26};
27
28const waitUntilStopped = async (pid: number, timeoutMs: number): Promise<boolean> => {
29 const deadline = performance.now() + timeoutMs;
30 while (performance.now() < deadline) {
31 if (!isAlive(pid)) return true;
32 await new Promise((resolve) => setTimeout(resolve, 50));
33 }
34 return !isAlive(pid);
35};
36
37/** Stop the detached daemon elected by an `executor mcp` cold start. */
38export const stopAutoSpawnedDaemon = async (dataDir: string): Promise<void> => {

Callers 1

stopAutoSpawnedDaemonFunction · 0.85

Calls 1

isAliveFunction · 0.70

Tested by

no test coverage detected