Skip to content

Commit

Permalink
Don't panic on connection failure to ES
Browse files Browse the repository at this point in the history
  • Loading branch information
rowanseymour committed May 11, 2022
1 parent 2652135 commit c8b3ee4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions utils/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ func init() {
}

func shouldRetry(request *http.Request, response *http.Response, withDelay time.Duration) bool {
// no response is a connection timeout which we can retry
if response == nil {
return true
}

// 429 Too Many Requests is recoverable. Sometimes the server puts
// a Retry-After response header to indicate when the server is
// available to start processing request from client.
Expand Down

0 comments on commit c8b3ee4

Please sign in to comment.