MCPcopy Create free account
hub / github.com/coder/mux / waitForPreferenceFile

Function waitForPreferenceFile

src/node/services/agentSession.startupAutoRetry.test.ts:1529–1538  ·  view source on GitHub ↗
(timeoutMs = 2000)

Source from the content-addressed store, hash-verified

1527
1528 const preferencePath = privateSession.getAutoRetryPreferencePath();
1529 const waitForPreferenceFile = async (timeoutMs = 2000): Promise<boolean> => {
1530 const start = Date.now();
1531 while (Date.now() - start < timeoutMs) {
1532 if (await Bun.file(preferencePath).exists()) {
1533 return true;
1534 }
1535 await new Promise((resolve) => setTimeout(resolve, 10));
1536 }
1537 return false;
1538 };
1539
1540 expect(await waitForPreferenceFile()).toBe(true);
1541

Calls 1

fileMethod · 0.45

Tested by

no test coverage detected