MCPcopy Create free account
hub / github.com/clawbot7/cli-gateway / waitUntil

Function waitUntil

test/bindingRuntime.prompt.test.ts:1208–1220  ·  view source on GitHub ↗
(
  check: () => boolean,
  opts?: { debug?: () => string },
)

Source from the content-addressed store, hash-verified

1206});
1207
1208async function waitUntil(
1209 check: () => boolean,
1210 opts?: { debug?: () => string },
1211): Promise<void> {
1212 const start = Date.now();
1213 while (!check()) {
1214 if (Date.now() - start > 2000) {
1215 const extra = opts?.debug ? ` debug=${opts.debug()}` : '';
1216 throw new Error(`timeout${extra}`);
1217 }
1218 await new Promise((r) => setTimeout(r, 10));
1219 }
1220}

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected