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

Function waitForService

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

Source from the content-addressed store, hash-verified

260}
261
262async function waitForService(name, url, timeoutMs = 30000) {
263 const start = Date.now();
264
265 while (Date.now() - start < timeoutMs) {
266 try {
267 const res = await fetch(url);
268 if (res.ok) {
269 logService(name, `Ready at ${url}`, c.green);
270 return true;
271 }
272 } catch {
273 // Keep trying
274 }
275 await delay(500);
276 }
277
278 logService(name, `Timeout waiting for ${url}`, c.red);
279 return false;
280}
281
282// ═══════════════════════════════════════════════════════════════════════════
283// Service Starters (agent-server + automation are byte-for-byte the same as

Callers 1

mainFunction · 0.70

Calls 1

logServiceFunction · 0.70

Tested by

no test coverage detected