Skip to content

Commit

Permalink
feat: double retryablehttp retry setting values
Browse files Browse the repository at this point in the history
* RetryWaitMin: increase to 2 seconds (library default is 1 second)
* RetryWaitMax: increase to 60 seconds (library default is 30 seconds)
* RetryMax: increase to 7 (library default is 4)
  • Loading branch information
rriski committed Sep 19, 2024
1 parent 6c4af16 commit 5395533
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions client.go
Original file line number Diff line number Diff line change
@@ -42,6 +42,17 @@ func NewClient(opts ...Option) (Client, error) {
c := retryablehttp.NewClient()
c.Logger = nil
c.CheckRetry = checkRetry

// Configure retry settings: 8 attempts in total, 2 seconds between retries
const (
//nolint:revive
retryWaitMin = 2 * time.Second
retryWaitMax = 60 * time.Second
retryMax = 7
)
c.RetryWaitMin = retryWaitMin // Default is 1 second
c.RetryWaitMax = retryWaitMax // Default is 30 seconds
c.RetryMax = retryMax // Default is 4 retries (5 attempts in total)
d.doer = c.StandardClient()

// User settings

0 comments on commit 5395533

Please sign in to comment.