MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / isPidAlive

Function isPidAlive

apps/cli/src/daemon-state.ts:384–392  ·  view source on GitHub ↗
(pid: number)

Source from the content-addressed store, hash-verified

382// ---------------------------------------------------------------------------
383
384export const isPidAlive = (pid: number): boolean => {
385 if (!Number.isInteger(pid) || pid <= 0) return false;
386 try {
387 process.kill(pid, 0);
388 return true;
389 } catch {
390 return false;
391 }
392};
393
394export const terminatePid = (pid: number): Effect.Effect<void, Error> =>
395 Effect.try({

Callers 9

resolveDaemonTargetFunction · 0.90
spawnDaemonAsLockHolderFunction · 0.90
stopDaemonFunction · 0.90
runDaemonSessionFunction · 0.90
main.tsFile · 0.90
acquireDaemonStartLockFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected