Skip to content

Commit

Permalink
Merge pull request #127 from saschagrunert/simplify
Browse files Browse the repository at this point in the history
Simplify retry logic
  • Loading branch information
k8s-ci-robot authored Feb 3, 2025
2 parents 196ffaa + d608579 commit ff25b35
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions http/agent.go
Original file line number Diff line number Diff line change
Expand Up @@ -192,11 +192,8 @@ func (a *Agent) retryRequest(do func() (*http.Response, error)) (response *http.
err = retry.Do(func() error {
//nolint:bodyclose // The API consumer should close the body
response, err = do()
if retryErr := shouldRetry(response, err); retryErr != nil {
return retryErr
}

return nil
return shouldRetry(response, err)
},
retry.Attempts(a.options.Retries),
retry.Delay(a.options.WaitTime),
Expand Down

0 comments on commit ff25b35

Please sign in to comment.