Skip to content

Commit f2ab874

Browse files
authored
Merge pull request nyaruka#48 from nyaruka/retry_fix
Don't panic on connection failure to ES
2 parents 2652135 + c8b3ee4 commit f2ab874

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

utils/http.go

+5
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ func init() {
2525
}
2626

2727
func shouldRetry(request *http.Request, response *http.Response, withDelay time.Duration) bool {
28+
// no response is a connection timeout which we can retry
29+
if response == nil {
30+
return true
31+
}
32+
2833
// 429 Too Many Requests is recoverable. Sometimes the server puts
2934
// a Retry-After response header to indicate when the server is
3035
// available to start processing request from client.

0 commit comments

Comments
 (0)