We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2385017 commit 1b975f4Copy full SHA for 1b975f4
src/util/promise.ts
@@ -5,10 +5,11 @@ export async function waitUntil<T extends unknown>(
5
tries: number,
6
test: () => Promise<T>
7
): Promise<Exclude<T, false>> {
8
- let result = tries > 0 && await test()
+ let remainingTries = tries;
9
+ let result = remainingTries > 0 && await test();
10
- while (tries > 0 && !result) {
11
- tries = tries - 1;
+ while (remainingTries > 0 && !result) {
12
+ remainingTries = remainingTries - 1;
13
await delay(delayMs);
14
result = await test();
15
}
0 commit comments