Skip to content

Commit 1b975f4

Browse files
committed
Fix retry count in error message in waitUntil
1 parent 2385017 commit 1b975f4

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/util/promise.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,11 @@ export async function waitUntil<T extends unknown>(
55
tries: number,
66
test: () => Promise<T>
77
): Promise<Exclude<T, false>> {
8-
let result = tries > 0 && await test()
8+
let remainingTries = tries;
9+
let result = remainingTries > 0 && await test();
910

10-
while (tries > 0 && !result) {
11-
tries = tries - 1;
11+
while (remainingTries > 0 && !result) {
12+
remainingTries = remainingTries - 1;
1213
await delay(delayMs);
1314
result = await test();
1415
}

0 commit comments

Comments
 (0)