mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-27 03:49:51 +02:00
12 lines
203 B
TypeScript
12 lines
203 B
TypeScript
export function isPidAlive(pid: number): boolean {
|
|
if (!Number.isFinite(pid) || pid <= 0) {
|
|
return false;
|
|
}
|
|
try {
|
|
process.kill(pid, 0);
|
|
return true;
|
|
} catch {
|
|
return false;
|
|
}
|
|
}
|