Skip to content

Commit

Permalink
CR
Browse files Browse the repository at this point in the history
  • Loading branch information
yahavi committed Dec 25, 2023
1 parent e167cb4 commit 62e321f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion http/httpclient/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ func (jc *HttpClient) Send(method, url string, content []byte, followRedirect, c
if resp == nil {
return false, errorutils.CheckErrorf("%sReceived empty response from server", logMsgPrefix)
}
if shouldRetry := jc.shouldRetry(resp, &httpClientsDetails); !shouldRetry {
if !jc.shouldRetry(resp, &httpClientsDetails) {
return false, nil
}
// Perform retry
Expand Down
3 changes: 2 additions & 1 deletion utils/io/httputils/httpclient.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ type HttpClientDetails struct {
Transport *http.Transport
DialTimeout time.Duration
OverallRequestTimeout time.Duration
PreRetryInterceptors []PreRetryInterceptor
// Prior to each retry attempt, the list of PreRetryInterceptors is invoked sequentially. If any of these interceptors yields a 'false' response, the retry process stops instantly.
PreRetryInterceptors []PreRetryInterceptor
}

type PreRetryInterceptor func() (shouldRetry bool)
Expand Down

0 comments on commit 62e321f

Please sign in to comment.