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

Function trySignalProcess

src/utils/process-identity.ts:78–87  ·  view source on GitHub ↗
(pid: number, signal: NodeJS.Signals)

Source from the content-addressed store, hash-verified

76}
77
78function trySignalProcess(pid: number, signal: NodeJS.Signals): boolean {
79 try {
80 process.kill(pid, signal);
81 return true;
82 } catch (err) {
83 const code = (err as NodeJS.ErrnoException).code;
84 if (code === 'ESRCH' || code === 'EPERM') return false;
85 throw err;
86 }
87}
88
89export async function waitForProcessExit(pid: number, timeoutMs: number): Promise<boolean> {
90 if (!isProcessAlive(pid)) return true;

Callers 1

stopProcessForTakeoverFunction · 0.85

Calls 1

killMethod · 0.45

Tested by

no test coverage detected