Skip to content

Commit

Permalink
Fix: timeout error has happened so often.
Browse files Browse the repository at this point in the history
  • Loading branch information
jsakamoto committed Feb 10, 2024
1 parent 20c2b7d commit 71e72e2
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const waitFor = async (arg) => {
const result = arg.predecate();
if (result !== false)
return result;
if (retryCount >= ((_a = arg.maxRetryCount) !== null && _a !== void 0 ? _a : 50))
if (retryCount >= ((_a = arg.maxRetryCount) !== null && _a !== void 0 ? _a : 500))
throw new TimeoutError("Timeout");
retryCount++;
await delay((_b = arg.retryInterval) !== null && _b !== void 0 ? _b : 10);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const waitFor = async <T>(arg: { predecate: () => false | T, maxRetryCount?: num
while (true) {
const result = arg.predecate();
if (result !== false) return result as T;
if (retryCount >= (arg.maxRetryCount ?? 50)) throw new TimeoutError("Timeout");
if (retryCount >= (arg.maxRetryCount ?? 500)) throw new TimeoutError("Timeout");
retryCount++;
await delay(arg.retryInterval ?? 10);
}
Expand Down

0 comments on commit 71e72e2

Please sign in to comment.