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

Function handler

scripts/spawn-dev-server.mjs:223–241  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

221
222 for (const signal of terminationSignals) {
223 const handler = () => {
224 if (
225 !managePosixProcessGroup &&
226 (child.exitCode !== null || child.signalCode !== null)
227 ) {
228 return;
229 }
230
231 forwardedSignal = signal;
232 const terminationPromise = terminateProcessTree
233 ? process.platform === "win32"
234 ? terminateWindowsProcessTree(child, signal)
235 : terminatePosixProcessGroup(child, signal)
236 : Promise.resolve(child.kill(signal));
237 terminationPromises.push(terminationPromise);
238 // The child may take longer to exit than the termination command takes to
239 // fail. Attach a handler now and rethrow when both operations are awaited.
240 void terminationPromise.catch(() => {});
241 };
242
243 signalHandlers.set(signal, handler);
244 process.on(signal, handler);

Callers

nothing calls this directly

Calls 5

killMethod · 0.80
resolveMethod · 0.45
pushMethod · 0.45

Tested by

no test coverage detected