Skip to content

Commit

Permalink
Merge pull request #48 from nyaruka/retry_fix
Browse files Browse the repository at this point in the history
Don't panic on connection failure to ES
  • Loading branch information
rowanseymour authored May 11, 2022
2 parents 2652135 + c8b3ee4 commit f2ab874
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 f2ab874

Please sign in to comment.