Skip to content

Commit

Permalink
fix: fix retry handler option
Browse files Browse the repository at this point in the history
  • Loading branch information
acommodari committed Mar 14, 2024
1 parent 07019d0 commit c982041
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions lib/handler/retry-handler.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
'use strict'
const assert = require('node:assert')

const { kRetryHandlerDefaultRetry } = require('../core/symbols')
Expand Down Expand Up @@ -37,7 +38,7 @@ class RetryHandler {
retry: retryFn ?? RetryHandler[kRetryHandlerDefaultRetry],
retryAfter: retryAfter ?? true,
maxTimeout: maxTimeout ?? 30 * 1000, // 30s,
timeout: minTimeout ?? 500, // .5s
minTimeout: minTimeout ?? 500, // .5s
timeoutFactor: timeoutFactor ?? 2,
maxRetries: maxRetries ?? 5,
// What errors we should retry
Expand Down Expand Up @@ -104,7 +105,7 @@ class RetryHandler {
const { method, retryOptions } = opts
const {
maxRetries,
timeout,
minTimeout,
maxTimeout,
timeoutFactor,
statusCodes,
Expand All @@ -114,7 +115,7 @@ class RetryHandler {
let { counter, currentTimeout } = state

currentTimeout =
currentTimeout != null && currentTimeout > 0 ? currentTimeout : timeout
currentTimeout != null && currentTimeout > 0 ? currentTimeout : minTimeout

// Any code that is not a Undici's originated and allowed to retry
if (
Expand Down

0 comments on commit c982041

Please sign in to comment.