MCPcopy Create free account
hub / github.com/TraderAlice/OpenAlice / defaultIsProcessAlive

Function defaultIsProcessAlive

src/workspaces/process-lock.ts:118–126  ·  view source on GitHub ↗
(pid: number, hostname: string)

Source from the content-addressed store, hash-verified

116}
117
118function defaultIsProcessAlive(pid: number, hostname: string): boolean {
119 if (hostname !== osHostname()) return true
120 try {
121 process.kill(pid, 0)
122 return true
123 } catch {
124 return false
125 }
126}
127
128function isErrno(err: unknown, code: string): boolean {
129 return err instanceof Error && 'code' in err && (err as NodeJS.ErrnoException).code === code

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected