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

Function waitForService

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

Source from the content-addressed store, hash-verified

261}
262
263async function waitForService(name, url, timeoutMs = 30000) {
264 const start = Date.now();
265
266 while (Date.now() - start < timeoutMs) {
267 try {
268 const res = await fetch(url);
269 if (res.ok) {
270 logService(name, `Ready at ${url}`, c.green);
271 return true;
272 }
273 } catch {
274 // Keep trying
275 }
276 await delay(500);
277 }
278
279 logService(name, `Timeout waiting for ${url}`, c.red);
280 return false;
281}
282
283// ═══════════════════════════════════════════════════════════════════════════
284// 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