MCPcopy Create free account
hub / github.com/garrytan/gstack / isAlive

Function isAlive

ios-qa/daemon/src/single-instance.ts:114–123  ·  view source on GitHub ↗
(pid: number)

Source from the content-addressed store, hash-verified

112}
113
114function isAlive(pid: number): boolean {
115 if (!Number.isInteger(pid) || pid <= 0) return false;
116 try {
117 process.kill(pid, 0);
118 return true;
119 } catch (err: unknown) {
120 const e = err as { code?: string };
121 return e.code !== 'ESRCH';
122 }
123}
124
125/**
126 * Spawn a daemon process and wait for the READY line. Returns the port the

Callers 1

tryClaimFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected