Skip to content

Commit

Permalink
Merge pull request #278 from blockfrost/chore/retry-520
Browse files Browse the repository at this point in the history
chore: retry on 520 used by Cloudflare
  • Loading branch information
slowbackspace authored Jul 26, 2023
2 parents 0cda8e7 + 728570b commit 81a110e
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion CHANGELOG.MD
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Added

- enabled retry logic for requests failing on `EPROTO` error and `520` status code

### Changed

- 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
- bump `@blockfrost/openapi` dep

### 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 81a110e

Please sign in to comment.