Skip to content

Commit

Permalink
chore: retry on 520 used by Cloudflare
Browse files Browse the repository at this point in the history
  • Loading branch information
slowbackspace committed Jul 26, 2023
1 parent c960871 commit 82b1f9d
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.MD
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- drop Node.js 14 support from build and readme
- bump `@emurgo/cardano-serialization-lib-nodejs` and dev deps
- enabled retry logic for requests failing on `EPROTO` error
- enabled retry logic for requests failing on `EPROTO` error and `520` status code

### Fixed

Expand Down
2 changes: 1 addition & 1 deletion src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ export const validateOptions = (options?: Options): ValidatedOptions => {
retrySettings: options.retrySettings ?? {
limit: 3, // retry count
methods: ['GET', 'PUT', 'HEAD', 'DELETE', 'OPTIONS', 'TRACE'], // no retry on POST
statusCodes: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524],
statusCodes: [408, 413, 429, 500, 502, 503, 504, 520, 521, 522, 524],
errorCodes: [
'ETIMEDOUT',
'ECONNRESET',
Expand Down
2 changes: 1 addition & 1 deletion test/tests/utils/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ describe('utils', () => {
retrySettings: {
limit: 3,
methods: ['GET', 'PUT', 'HEAD', 'DELETE', 'OPTIONS', 'TRACE'],
statusCodes: [408, 413, 429, 500, 502, 503, 504, 521, 522, 524],
statusCodes: [408, 413, 429, 500, 502, 503, 504, 520, 521, 522, 524],
errorCodes: [
'ETIMEDOUT',
'ECONNRESET',
Expand Down

0 comments on commit 82b1f9d

Please sign in to comment.