Skip to content

Commit ff25b35

Browse files
authored
Merge pull request #127 from saschagrunert/simplify
Simplify retry logic
2 parents 196ffaa + d608579 commit ff25b35

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

http/agent.go

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -192,11 +192,8 @@ func (a *Agent) retryRequest(do func() (*http.Response, error)) (response *http.
192192
err = retry.Do(func() error {
193193
//nolint:bodyclose // The API consumer should close the body
194194
response, err = do()
195-
if retryErr := shouldRetry(response, err); retryErr != nil {
196-
return retryErr
197-
}
198195

199-
return nil
196+
return shouldRetry(response, err)
200197
},
201198
retry.Attempts(a.options.Retries),
202199
retry.Delay(a.options.WaitTime),

0 commit comments

Comments
 (0)