MCPcopy Create free account
hub / github.com/cloudflare/computer / stopProcess

Function stopProcess

packages/computerd/src/cli/computerd.test.ts:516–535  ·  view source on GitHub ↗
(child)

Source from the content-addressed store, hash-verified

514}
515
516function stopProcess(child) {
517 return new Promise((resolve, reject) => {
518 if (child.exitCode !== null || child.signalCode !== null) {
519 resolve();
520 return;
521 }
522
523 const timeout = setTimeout(() => {
524 child.kill("SIGKILL");
525 reject(new Error("timed out waiting for computerd to exit"));
526 }, 2_000);
527
528 child.once("exit", () => {
529 clearTimeout(timeout);
530 resolve();
531 });
532
533 child.kill("SIGTERM");
534 });
535}

Callers 1

startComputerdFunction · 0.85

Calls 1

killMethod · 0.65

Tested by

no test coverage detected