Skip to content

Commit

Permalink
Added axios retry logic when fetching remote chunk from url (#173)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielRicaud authored Apr 6, 2023
1 parent 44e8c4b commit fe6ee59
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 0 deletions.
64 changes: 64 additions & 0 deletions lib/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions lib/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
"dependencies": {
"@aws-sdk/client-s3": "3.197.0",
"axios": "^1.2.3",
"axios-retry": "^3.4.0",
"browser-fs-access": "^0.31.2",
"buffer": "^6.0.3",
"buffer-crc32": "^0.2.13",
Expand Down
4 changes: 4 additions & 0 deletions lib/tdf3/src/utils/chunkers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@ import axios, { AxiosResponse } from 'axios';
import { Buffer } from 'buffer';
import { createReadStream, readFile, statSync } from 'fs';
import { type AnyTdfStream, isAnyTdfStream } from '../client/tdf-stream.js';
import axiosRetry from 'axios-retry';

// @ts-ignore
axiosRetry(axios, { retries: 3 }); // Retries all idempotent requests (GET, HEAD, OPTIONS, PUT, DELETE)

/**
* Read data from a seekable stream.
Expand Down

0 comments on commit fe6ee59

Please sign in to comment.