MCPcopy Index your code
hub / github.com/NativeScript/SimDeck / waitForHealth

Function waitForHealth

scripts/integration/webrtc.mjs:185–197  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

183}
184
185async function waitForHealth() {
186 const deadline = Date.now() + 30_000;
187 while (Date.now() < deadline) {
188 try {
189 const health = await httpJson("/api/health");
190 if (health.httpPort === serverPort) {
191 return;
192 }
193 } catch {}
194 await sleep(100);
195 }
196 throw new Error(`Timed out waiting for ${serverUrl}/api/health`);
197}
198
199async function launchFixtureWithRecovery(appPath, options = {}) {
200 const recoveryCount = options.recoveryCount ?? 0;

Callers 1

mainFunction · 0.70

Calls 2

httpJsonFunction · 0.70
sleepFunction · 0.70

Tested by

no test coverage detected