Skip to content

Commit

Permalink
fix: retry delay func triggering infinite retry on every error
Browse files Browse the repository at this point in the history
  • Loading branch information
slowbackspace committed Nov 25, 2021
1 parent cc9922d commit 29fe991
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ export const validateOptions = (options?: Options): ValidatedOptions => {
'ENETUNREACH',
'EAI_AGAIN',
],
calculateDelay: (_retryObject: RetryObject) => 1000, // 1s retry delay
calculateDelay: (_retryObject: RetryObject) =>
_retryObject.computedValue !== 0 ? 1000 : 0, // check if retry should be enabled, if so set 1s retry delay
// maxRetryAfter: undefined,
// backoffLimit: Number.POSITIVE_INFINITY,
// noise: 100
Expand Down

0 comments on commit 29fe991

Please sign in to comment.