MCPcopy Create free account
hub / github.com/heygen-com/hyperframes / killTrackedProcesses

Function killTrackedProcesses

packages/engine/src/utils/processTracker.ts:16–41  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

14 * after a short grace period.
15 */
16export function killTrackedProcesses(): void {
17 const alive: ChildProcess[] = [];
18 for (const proc of tracked) {
19 if (!proc.killed) {
20 try {
21 proc.kill("SIGTERM");
22 alive.push(proc);
23 } catch {
24 // Already exited between the check and the kill.
25 }
26 }
27 }
28 tracked.clear();
29
30 if (alive.length === 0) return;
31
32 setTimeout(() => {
33 for (const proc of alive) {
34 try {
35 proc.kill("SIGKILL");
36 } catch {
37 // Already exited.
38 }
39 }
40 }, 500).unref();
41}

Callers 3

cleanupFunction · 0.85
runEmbeddedModeFunction · 0.85

Calls 2

killMethod · 0.80
clearMethod · 0.45

Tested by

no test coverage detected