Do not repair if download error, just retry from client side

This commit is contained in:
Ben Adrian Sarmiento
2024-08-25 13:48:01 +02:00
parent 54230c9eaa
commit 78be877efe
3 changed files with 10 additions and 42 deletions

View File

@@ -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