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

Function stopProc

e2e/local/cli-mcp-daemon-attach-stress.test.ts:108–116  ·  view source on GitHub ↗
(proc: DaemonProc)

Source from the content-addressed store, hash-verified

106 : new Promise((resolve) => proc.once("exit", () => resolve()));
107
108const stopProc = async (proc: DaemonProc): Promise<void> => {
109 if (proc.exitCode !== null || proc.signalCode !== null) return;
110 if (proc.pid) process.kill(-proc.pid, "SIGTERM");
111 await Promise.race([exited(proc), new Promise<void>((resolve) => setTimeout(resolve, 3000))]);
112 if (proc.exitCode === null && proc.signalCode === null && proc.pid) {
113 process.kill(-proc.pid, "SIGKILL");
114 await exited(proc);
115 }
116};
117
118const startForegroundDaemon = (dataDir: string) =>
119 Effect.acquireRelease(

Callers 1

startForegroundDaemonFunction · 0.85

Calls 2

killMethod · 0.80
exitedFunction · 0.70

Tested by

no test coverage detected