mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-04-24 22:30:03 +00:00
Feature: Better retry policy in binstalk-downloader
(#794)
Fixed #779 #791 - Retry request on timeout - Retry for `StatusCode::{REQUEST_TIMEOUT, GATEWAY_TIMEOUT}` - Add `DEFAULT_RETRY_DURATION_FOR_RATE_LIMIT` for 503/429 if 503/429 does not give us a header or give us an invalid header on when to retry, we would default to `DEFAULT_RETRY_DURATION_FOR_RATE_LIMIT`. - Fix `Client::get_redirected_final_url`: Retry using `GET` on status code 400..405 + 410 - Rename remote_exists => remote_gettable & support fallback to GET if HEAD fails due to status code 400..405 + 410. - Improve `Client::get_stream`: Include url & method in the err of the stream returned Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
parent
1b2fb08bcb
commit
87686cb2f7
6 changed files with 202 additions and 91 deletions
|
@ -193,8 +193,11 @@ pub fn logging(log_level: LevelFilter, json_output: bool) {
|
|||
// Calculate log_level
|
||||
let log_level = min(log_level, STATIC_MAX_LEVEL);
|
||||
|
||||
let allowed_targets =
|
||||
(log_level != LevelFilter::Trace).then_some(["binstalk", "cargo_binstall"]);
|
||||
let allowed_targets = (log_level != LevelFilter::Trace).then_some([
|
||||
"binstalk",
|
||||
"binstalk_downloader",
|
||||
"cargo_binstall",
|
||||
]);
|
||||
|
||||
// Forward log to tracing
|
||||
Logger::init(log_level);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue