MCPcopy Index your code
hub / github.com/callstack/agent-device / stopProcess

Function stopProcess

src/__tests__/client-metro.test.ts:371–385  ·  view source on GitHub ↗
(pid: number)

Source from the content-addressed store, hash-verified

369}
370
371async function stopProcess(pid: number): Promise<void> {
372 if (!pid || !isProcessAlive(pid)) return;
373 try {
374 process.kill(pid, 'SIGTERM');
375 } catch {
376 return;
377 }
378 if (await waitForProcessExit(pid, 1_500)) return;
379 try {
380 process.kill(pid, 'SIGKILL');
381 } catch {
382 return;
383 }
384 await waitForProcessExit(pid, 1_500);
385}

Callers 1

Calls 3

isProcessAliveFunction · 0.90
waitForProcessExitFunction · 0.90
killMethod · 0.45

Tested by

no test coverage detected