repair fixes
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
package http
|
||||
|
||||
import (
|
||||
"io"
|
||||
"net/http"
|
||||
"strings"
|
||||
"time"
|
||||
@@ -54,14 +53,10 @@ func NewHTTPClient(token string, maxRetries int, c config.ConfigInterface) *HTTP
|
||||
if err != nil {
|
||||
return true
|
||||
}
|
||||
if resp.StatusCode < 200 || resp.StatusCode >= 300 {
|
||||
body, _ := io.ReadAll(resp.Body)
|
||||
body2, _ := io.ReadAll(resp.Request.Body)
|
||||
log.Errorf("Received a %s %s from %s", resp.Status, string(body), resp.Request.URL)
|
||||
log.Errorf("request %s %s", string(body2), resp.Request.URL)
|
||||
if resp.StatusCode == 429 {
|
||||
return true
|
||||
}
|
||||
// no need to retry because the status code is 2XX
|
||||
// no need to retry
|
||||
return false
|
||||
},
|
||||
log: logutil.NewLogger().Named("http"),
|
||||
|
||||
Reference in New Issue
Block a user