Skip to content

Commit

Permalink
feat(vhd-lib): use exponential retry delay when failing to write a chunk
Browse files Browse the repository at this point in the history
  • Loading branch information
fbeauchamp committed Jan 13, 2022
1 parent 34efe74 commit 47c26d4
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions packages/vhd-lib/Vhd/VhdDirectory.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ exports.VhdDirectory = class VhdDirectory extends VhdAbstract {
// https://www.backblaze.com/b2/docs/calling.html#error_handling
return pRetry(async () => this._handler.outputFile(this._getChunkPath(partName), compressed, this._opts), {
tries: 5,
delays: [100, 200, 500, 1000, 2000],
when: e => e.code === 'InternalError',
onRetry: () => {
warn('retrying writechunk', { partName })
Expand Down

0 comments on commit 47c26d4

Please sign in to comment.