@@ -71,12 +71,15 @@ func NewClient(p Params) *Client {
|
||||
restClient: enteAPI,
|
||||
downloadClient: resty.New().
|
||||
SetRetryCount(3).
|
||||
SetRetryWaitTime(5 * time.Second).
|
||||
SetRetryMaxWaitTime(10 * time.Second).
|
||||
SetRetryWaitTime(10 * time.Second).
|
||||
SetRetryMaxWaitTime(20 * time.Second).
|
||||
AddRetryCondition(func(r *resty.Response, err error) bool {
|
||||
shouldRetry := r.StatusCode() == 429 || r.StatusCode() > 500
|
||||
shouldRetry := r.StatusCode() == 429 || r.StatusCode() >= 500
|
||||
if shouldRetry {
|
||||
log.Printf("retrying download due to %d code", r.StatusCode())
|
||||
amxRequestID := r.Header().Get("X-Amz-Request-Id")
|
||||
cfRayID := r.Header().Get("CF-Ray")
|
||||
wasabiRefID := r.Header().Get("X-Wasabi-Cm-Reference-Id")
|
||||
log.Printf("Retry scheduled. error statusCode: %d, X-Amz-Request-Id: %s, CF-Ray: %s, X-Wasabi-Cm-Reference-Id: %s", r.StatusCode(), amxRequestID, cfRayID, wasabiRefID)
|
||||
}
|
||||
return shouldRetry
|
||||
}),
|
||||
|
||||
@@ -15,7 +15,7 @@ import (
|
||||
"strings"
|
||||
)
|
||||
|
||||
var AppVersion = "0.1.14"
|
||||
var AppVersion = "0.1.15"
|
||||
|
||||
func main() {
|
||||
cliDBPath, err := GetCLIConfigPath()
|
||||
|
||||
Reference in New Issue
Block a user