MCPcopy Create free account
hub / github.com/delinoio/oss / terminatePosixProcessGroup

Function terminatePosixProcessGroup

scripts/spawn-dev-server.mjs:180–197  ·  view source on GitHub ↗
(child, signal)

Source from the content-addressed store, hash-verified

178}
179
180export async function terminatePosixProcessGroup(child, signal) {
181 const processGroupId = -child.pid;
182 if (!signalPosixProcessGroup(child, processGroupId, signal)) return;
183 try {
184 await waitForPosixProcessGroupExit(processGroupId);
185 return;
186 } catch (error) {
187 if (
188 !(error instanceof PosixProcessGroupExitTimeout) ||
189 signal === "SIGKILL"
190 ) {
191 throw error;
192 }
193 }
194
195 if (!signalPosixProcessGroup(child, processGroupId, "SIGKILL")) return;
196 await waitForPosixProcessGroupExit(processGroupId);
197}
198
199export async function spawnDevServer(
200 command,

Callers 2

terminateTreeFunction · 0.90
handlerFunction · 0.85

Calls 2

signalPosixProcessGroupFunction · 0.85

Tested by

no test coverage detected