MCPcopy Create free account
hub / github.com/OpenHands/OpenHands / waitForService

Function waitForService

scripts/dev-static.mjs:289–307  ·  view source on GitHub ↗
(name, url, timeoutMs = 30000)

Source from the content-addressed store, hash-verified

287}
288
289async function waitForService(name, url, timeoutMs = 30000) {
290 const start = Date.now();
291
292 while (Date.now() - start < timeoutMs) {
293 try {
294 const res = await fetch(url);
295 if (res.ok) {
296 logService(name, `Ready at ${url}`, c.green);
297 return true;
298 }
299 } catch {
300 // Keep trying
301 }
302 await delay(500);
303 }
304
305 logService(name, `Timeout waiting for ${url}`, c.red);
306 return false;
307}
308
309// ═══════════════════════════════════════════════════════════════════════════
310// Service Starters (agent-server + automation are byte-for-byte the same as

Callers 1

mainFunction · 0.70

Calls 2

delayFunction · 0.85
logServiceFunction · 0.70

Tested by

no test coverage detected