Skip to content

Commit

Permalink
fix: preserve retry on 409 to pass tests
Browse files Browse the repository at this point in the history
  • Loading branch information
nikochiko committed Sep 4, 2024
1 parent 9143992 commit 27f3ae2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/core/fetcher/requestWithRetries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export async function requestWithRetries(
let response: Response = await requestFn();

for (let i = 0; i < maxRetries; ++i) {
if ([408, 429, 502, 503, 504].includes(response.status)) {
if ([408, 409, 429, 502, 503, 504].includes(response.status)) {
const delay = Math.min(INITIAL_RETRY_DELAY * Math.pow(2, i), MAX_RETRY_DELAY);
await new Promise((resolve) => setTimeout(resolve, delay));
response = await requestFn();
Expand Down

0 comments on commit 27f3ae2

Please sign in to comment.