Skip to content
This repository has been archived by the owner on Jun 12, 2022. It is now read-only.

Commit

Permalink
fix(retry): stop retrying 404s
Browse files Browse the repository at this point in the history
Fixes: #19

Spurious 404s are generally rare, and retrying these is more likely to
make things slow than robust. True 404s happen all the damn time and are
often used as quick checks.
  • Loading branch information
zkat committed Apr 12, 2017
1 parent ed7f34a commit 6fafd53
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -304,7 +304,7 @@ with, uh, not knocking out people's routers. 🤓
An object that can be used to tune request retry settings. Retries will only be attempted on the following conditions:

* Request method is NOT `POST` AND
* Request status is one of: `404`, `408`, `420`, `429`, or any status in the 500-range. OR
* Request status is one of: `408`, `420`, `429`, or any status in the 500-range. OR
* Request errored with `ECONNRESET`, `ECONNREFUSED`, `EADDRINUSE`, `ETIMEDOUT`, or the `fetch` error `request-timeout`.

The following are worth noting as explicitly not retried:
Expand Down
1 change: 0 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,6 @@ function remoteFetch (uri, opts) {
// When hitting an API with rate-limiting features,
// be sure to set the `retry` settings according to
// documentation for that.
res.status === 404 || // Not Found ("subsequent requests permissible")
res.status === 408 || // Request Timeout
res.status === 420 || // Enhance Your Calm (usually Twitter rate-limit)
res.status === 429 || // Too Many Requests ("standard" rate-limiting)
Expand Down

0 comments on commit 6fafd53

Please sign in to comment.