MCPcopy Create free account
hub / github.com/CommonstackAI/UncommonRoute / waitForHealth

Function waitForHealth

openclaw-plugin/src/index.js:155–166  ·  view source on GitHub ↗
(port, timeoutMs = HEALTH_TIMEOUT_MS)

Source from the content-addressed store, hash-verified

153}
154
155async function waitForHealth(port, timeoutMs = HEALTH_TIMEOUT_MS) {
156 const url = `http://127.0.0.1:${port}/health`;
157 const deadline = Date.now() + timeoutMs;
158 while (Date.now() < deadline) {
159 try {
160 const resp = await fetch(url, { signal: AbortSignal.timeout(2000) });
161 if (resp.ok) return true;
162 } catch { /* not ready */ }
163 await sleep(HEALTH_POLL_MS);
164 }
165 return false;
166}
167
168async function fetchJson(url) {
169 try {

Callers 1

bootstrapFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected