MCPcopy Create free account
hub / github.com/ZenNotes/zennotes / waitForFile

Function waitForFile

tooling/scripts/perf-web-runtime.mjs:97–105  ·  view source on GitHub ↗
(path, timeoutMs)

Source from the content-addressed store, hash-verified

95}
96
97async function waitForFile(path, timeoutMs) {
98 const startedAt = performance.now()
99 const deadline = startedAt + timeoutMs
100 while (performance.now() < deadline) {
101 if (await fileExists(path)) return round(performance.now() - startedAt)
102 await sleep(50)
103 }
104 return null
105}
106
107function run(command, args, options = {}) {
108 return new Promise((resolvePromise, rejectPromise) => {

Callers 1

mainFunction · 0.70

Calls 3

fileExistsFunction · 0.70
roundFunction · 0.70
sleepFunction · 0.70

Tested by

no test coverage detected