MCPcopy Index your code
hub / github.com/AutoForgeAI/autoforge / readPid

Function readPid

lib/cli.js:429–437  ·  view source on GitHub ↗

Read PID from the PID file. Returns the PID number or null.

()

Source from the content-addressed store, hash-verified

427
428/** Read PID from the PID file. Returns the PID number or null. */
429function readPid() {
430 try {
431 const content = readFileSync(PID_FILE, 'utf8').trim();
432 const pid = Number(content);
433 return Number.isFinite(pid) && pid > 0 ? pid : null;
434 } catch {
435 return null;
436 }
437}
438
439/** Check whether a process with the given PID is still running. */
440function isProcessAlive(pid) {

Callers 1

startServerFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected