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

Function isProcessAlive

cli/src/utils/process.ts:6–17  ·  view source on GitHub ↗
(pid: number)

Source from the content-addressed store, hash-verified

4export const isWindows = (): boolean => process.platform === 'win32';
5
6export function isProcessAlive(pid: number): boolean {
7 if (!Number.isFinite(pid) || pid <= 0) {
8 return false;
9 }
10
11 try {
12 process.kill(pid, 0);
13 return true;
14 } catch {
15 return false;
16 }
17}
18
19function killProcessWindows(pid: number, force: boolean): boolean {
20 if (!isProcessAlive(pid)) {

Callers 10

acquireRunnerLockFunction · 0.90
runnerPostFunction · 0.90
waitForRunnerHandoffFunction · 0.90
waitForProcessDeathFunction · 0.90
startRunnerFunction · 0.90
maybeCleanupWorktreeFunction · 0.90
killProcessWindowsFunction · 0.70
waitForProcessToDieFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected