Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't retry 404s #899

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Don't retry 404s #899

wants to merge 2 commits into from

Conversation

cvalarida
Copy link
Contributor

Description

When proxy-fetch gets a non-ok response, it retries up to 5 times (total of 6 attempts). This doesn't make sense when the response is a 404 error.

@cvalarida cvalarida marked this pull request as ready for review February 21, 2025 21:57
@cvalarida cvalarida requested review from a team as code owners February 21, 2025 21:57
@@ -87,7 +87,7 @@ export const getFetcher = (
// In non-debug mode: only on final attempt
const logFailedRequest = debug ? true : attempt === retryCount + 1

if (!response.ok) {
if (!response.ok && response.status !== 404) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unless I'm reading this wrong, this still retries 404, it just doesn't log them. Is that the intent?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we wanted to abort for 404, on the next line change it to be if (logFailedRequest || response.status === 404)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants