MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / waitFor

Function waitFor

__tests__/mcp-projectpath-lifecycle.test.ts:44–51  ·  view source on GitHub ↗
(check: () => Promise<boolean>, timeoutMs: number)

Source from the content-addressed store, hash-verified

42}
43
44async function waitFor(check: () => Promise<boolean>, timeoutMs: number): Promise<boolean> {
45 const deadline = Date.now() + timeoutMs;
46 while (Date.now() < deadline) {
47 if (await check()) return true;
48 await new Promise((r) => setTimeout(r, 100));
49 }
50 return check();
51}
52
53// Every case drives real catch-up syncs and waits for them (see the gate note
54// below), so each gets room for a loaded Windows VM; cases that do more set

Calls 1

checkFunction · 0.70

Tested by

no test coverage detected