mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-06-18 00:26:37 +00:00
Fix too many 429 response (#1231)
Fixed #1229 Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
parent
e4c776f403
commit
435df675b3
11 changed files with 228 additions and 132 deletions
|
@ -21,7 +21,7 @@ mod request;
|
|||
pub use request::{GhApiContextError, GhApiError, GhGraphQLErrors};
|
||||
|
||||
/// default retry duration if x-ratelimit-reset is not found in response header
|
||||
const DEFAULT_RETRY_DURATION: Duration = Duration::from_secs(5 * 60);
|
||||
const DEFAULT_RETRY_DURATION: Duration = Duration::from_secs(10 * 60);
|
||||
|
||||
fn percent_encode_http_url_path(path: &str) -> PercentEncode<'_> {
|
||||
/// https://url.spec.whatwg.org/#fragment-percent-encode-set
|
||||
|
@ -289,7 +289,7 @@ pub enum HasReleaseArtifact {
|
|||
mod test {
|
||||
use super::*;
|
||||
use compact_str::{CompactString, ToCompactString};
|
||||
use std::env;
|
||||
use std::{env, num::NonZeroU16};
|
||||
|
||||
mod cargo_binstall_v0_20_1 {
|
||||
use super::{CompactString, GhRelease};
|
||||
|
@ -383,7 +383,7 @@ mod test {
|
|||
let client = remote::Client::new(
|
||||
concat!(env!("CARGO_PKG_NAME"), "/", env!("CARGO_PKG_VERSION")),
|
||||
None,
|
||||
Duration::from_millis(10),
|
||||
NonZeroU16::new(10).unwrap(),
|
||||
1.try_into().unwrap(),
|
||||
[],
|
||||
)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue