MCPcopy Create free account
hub / github.com/modem-dev/hunk / readHealth

Function readHealth

scripts/daemon-memory-check.ts:175–185  ·  view source on GitHub ↗
(port: number)

Source from the content-addressed store, hash-verified

173}
174
175async function readHealth(port: number): Promise<HealthResponse | null> {
176 try {
177 const response = await fetch(`http://127.0.0.1:${port}/health`);
178 if (!response.ok) {
179 return null;
180 }
181 return (await response.json()) as HealthResponse;
182 } catch {
183 return null;
184 }
185}
186
187function parseLinuxStatus(pid: number) {
188 if (process.platform !== "linux") {

Callers 2

sampleFunction · 0.70
mainFunction · 0.70

Calls 1

fetchFunction · 0.85

Tested by

no test coverage detected