MCPcopy Index your code
hub / github.com/callstack/agent-device / hasLiveDaemon

Function hasLiveDaemon

scripts/clean-daemon.ts:88–92  ·  view source on GitHub ↗
(stateDir: string)

Source from the content-addressed store, hash-verified

86}
87
88function hasLiveDaemon(stateDir: string): boolean {
89 const dirInfo = readDaemonInfo(path.join(stateDir, 'daemon.json'));
90 const pid = readPositivePid(dirInfo?.pid);
91 return pid !== null && isAgentDeviceDaemonProcess(pid, dirInfo?.processStartTime);
92}
93
94function readPositivePid(pid: number | undefined): number | null {
95 if (typeof pid !== 'number') return null;

Callers 1

pruneStaleDevStateDirsFunction · 0.85

Calls 3

readPositivePidFunction · 0.85
readDaemonInfoFunction · 0.70

Tested by

no test coverage detected