Skip to content

Commit 91d5673

Browse files
authored
Merge pull request #557 from SumoLogic/retry_50x
Allow retrying on 50x HTTP errors
2 parents c9d1953 + 0bdf9e0 commit 91d5673

File tree

1 file changed

+0
-10
lines changed

1 file changed

+0
-10
lines changed

sumologic/sumologic_client.go

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ package sumologic
22

33
import (
44
"bytes"
5-
"context"
65
"encoding/json"
76
"errors"
87
"fmt"
@@ -329,18 +328,9 @@ func (s *Client) Delete(urlPath string) ([]byte, error) {
329328
return d, nil
330329
}
331330

332-
func checkRetry(ctx context.Context, resp *http.Response, err error) (bool, error) {
333-
// only retry on 429
334-
if err == nil && resp.StatusCode == http.StatusTooManyRequests {
335-
return true, nil
336-
}
337-
return false, nil
338-
}
339-
340331
func NewClient(accessID, accessKey, authJwt, environment, base_url string, admin bool) (*Client, error) {
341332
retryClient := retryablehttp.NewClient()
342333
retryClient.RetryMax = 10
343-
retryClient.CheckRetry = checkRetry
344334
// Disable DEBUG logs (https://github.com/hashicorp/go-retryablehttp/issues/31)
345335
retryClient.Logger = nil
346336

0 commit comments

Comments
 (0)