MCPcopy Create free account
hub / github.com/tiann/hapi / killProcessByChildProcess

Function killProcessByChildProcess

cli/src/utils/process.ts:146–162  ·  view source on GitHub ↗
(
  child: ChildProcess,
  force: boolean = false
)

Source from the content-addressed store, hash-verified

144}
145
146export async function killProcessByChildProcess(
147 child: ChildProcess,
148 force: boolean = false
149): Promise<boolean> {
150 const pid = child.pid;
151 if (!pid) {
152 return false;
153 }
154
155 if (isWindows()) {
156 // Windows taskkill /T already kills the entire process tree
157 return killProcess(pid, force);
158 }
159
160 // Kill entire process tree on Unix to prevent orphan processes
161 return killProcessTree(pid, force);
162}

Callers 9

abortHandlerFunction · 0.90
abortHandlerMethod · 0.90
spawnSessionFunction · 0.90
stopSessionFunction · 0.90
disconnectMethod · 0.90
closeMethod · 0.90
handleLineMethod · 0.90
cleanupFunction · 0.90

Calls 3

isWindowsFunction · 0.85
killProcessFunction · 0.85
killProcessTreeFunction · 0.85

Tested by

no test coverage detected