Do not repair if download error, just retry from client side
This commit is contained in:
@@ -298,20 +298,8 @@ func (r *HTTPClient) shouldRetry(req *http.Request, resp *http.Response, err err
|
||||
default:
|
||||
return false
|
||||
}
|
||||
} else if downloadErr, ok := err.(*DownloadErrorResponse); ok {
|
||||
switch downloadErr.Message {
|
||||
case "invalid_download_code": // 404
|
||||
if attempts >= r.maxRetries {
|
||||
r.log.Debugf("Invalid download code, attempt #%d", attempts+1)
|
||||
return false
|
||||
}
|
||||
secs := r.backoff(attempts, rateLimitSleep)
|
||||
r.log.Debugf("Invalid download code, attempt #%d, retrying in %d seconds", attempts+1, secs/time.Second)
|
||||
time.Sleep(secs)
|
||||
return true
|
||||
default:
|
||||
return false
|
||||
}
|
||||
} else if _, ok := err.(*DownloadErrorResponse); ok {
|
||||
return false
|
||||
}
|
||||
|
||||
// succesful requests
|
||||
|
||||
Reference in New Issue
Block a user