MCPcopy Create free account
hub / github.com/anomalyco/opencode / wait

Function wait

packages/core/test/util/flock.test.ts:52–60  ·  view source on GitHub ↗
(file: string, timeout = 3_000)

Source from the content-addressed store, hash-verified

50}
51
52async function wait(file: string, timeout = 3_000) {
53 const stop = Date.now() + timeout
54 while (Date.now() < stop) {
55 if (await exists(file)) return
56 await sleep(20)
57 }
58
59 throw new Error(`Timed out waiting for file: ${file}`)
60}
61
62function run(msg: Msg) {
63 return new Promise<{ code: number; stdout: Buffer; stderr: Buffer }>((resolve) => {

Callers 1

flock.test.tsFile · 0.70

Calls 2

existsFunction · 0.70
sleepFunction · 0.70

Tested by

no test coverage detected