UNPKG

@syngrisi/syngrisi

Version:
18 lines 411 B
// src/server/utils/waitUntil.ts var waitUntil = async (cb, attempts = 5, interval = 700) => { let result = false; let iteration = 0; while (result === false) { result = await cb(); await new Promise((r) => setTimeout(r, interval)); iteration += 1; if (iteration > attempts) { result = true; } } return result; }; export { waitUntil }; //# sourceMappingURL=waitUntil.js.map