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

Function isAlive

e2e/local/daemon-process.ts:4–12  ·  view source on GitHub ↗
(pid: number)

Source from the content-addressed store, hash-verified

2import { join } from "node:path";
3
4const isAlive = (pid: number): boolean => {
5 // oxlint-disable-next-line executor/no-try-catch-or-throw -- boundary: process liveness probing reports false for an already-reaped test daemon
6 try {
7 process.kill(process.platform === "win32" ? pid : -pid, 0);
8 return true;
9 } catch {
10 return false;
11 }
12};
13
14const signal = (pid: number, name: NodeJS.Signals): void => {
15 // Auto-started daemons are detached process-group leaders. Signal the whole

Callers 1

waitUntilStoppedFunction · 0.70

Calls 1

killMethod · 0.80

Tested by

no test coverage detected