MCPcopy Create free account
hub / github.com/MoonshotAI/kimi-code / waitForServerHealthy

Function waitForServerHealthy

apps/kimi-code/src/cli/sub/server/shared.ts:171–182  ·  view source on GitHub ↗
(origin: string, timeoutMs: number)

Source from the content-addressed store, hash-verified

169
170/** Poll `/api/v1/healthz` until it reports healthy or `timeoutMs` elapses. */
171export async function waitForServerHealthy(origin: string, timeoutMs: number): Promise<boolean> {
172 const deadline = Date.now() + timeoutMs;
173 do {
174 if (await isServerHealthy(origin, 500)) {
175 return true;
176 }
177 await new Promise((resolve) => {
178 setTimeout(resolve, 200);
179 });
180 } while (Date.now() < deadline);
181 return false;
182}
183
184/**
185 * Probe `/` and confirm the bundled web UI is being served.

Callers 1

ensureDaemonFunction · 0.90

Calls 2

isServerHealthyFunction · 0.85
nowMethod · 0.65

Tested by

no test coverage detected