MCPcopy Create free account
hub / github.com/EvoMap/evolver / checkHealth

Function checkHealth

src/ops/lifecycle.js:691–705  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

689}
690
691function checkHealth() {
692 var pids = getOwnedLoopPids(getRunningPids());
693 if (pids.length === 0) return { healthy: false, reason: 'not_running' };
694 var proxyHealth = checkProxyHealth(process.env);
695 if (!proxyHealth.healthy) {
696 return Object.assign({ healthy: false }, proxyHealth);
697 }
698 if (fs.existsSync(LOG_FILE)) {
699 var silenceMs = Date.now() - fs.statSync(LOG_FILE).mtimeMs;
700 if (silenceMs > MAX_SILENCE_MS) {
701 return { healthy: false, reason: 'stagnation', silenceMinutes: Math.round(silenceMs / 60000) };
702 }
703 }
704 return { healthy: true, pids: pids };
705}
706
707// --- CLI ---
708if (require.main === module) {

Callers 2

lifecycle.jsFile · 0.85
watchRunFunction · 0.85

Calls 3

getOwnedLoopPidsFunction · 0.85
getRunningPidsFunction · 0.85
checkProxyHealthFunction · 0.85

Tested by

no test coverage detected