forked from Deuxfleurs/tricot
Cargo clippy
This commit is contained in:
parent
fdb83162ce
commit
e4942490ee
4 changed files with 6 additions and 6 deletions
|
@ -114,7 +114,7 @@ impl Consul {
|
||||||
};
|
};
|
||||||
|
|
||||||
let resp: ConsulNodeCatalog = http.json().await?;
|
let resp: ConsulNodeCatalog = http.json().await?;
|
||||||
return Ok((resp, new_idx));
|
Ok((resp, new_idx))
|
||||||
}
|
}
|
||||||
|
|
||||||
// ---- KV get and put ----
|
// ---- KV get and put ----
|
||||||
|
|
|
@ -104,7 +104,7 @@ async fn main() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn exit_on_err(e: anyhow::Error) -> () {
|
fn exit_on_err(e: anyhow::Error) {
|
||||||
error!("{}", e);
|
error!("{}", e);
|
||||||
std::process::exit(1);
|
std::process::exit(1);
|
||||||
}
|
}
|
||||||
|
|
|
@ -86,10 +86,10 @@ fn retry_to_time(retries: u32, max_time: Duration) -> Duration {
|
||||||
// 1.2^x seems to be a good value to exponentially increase time at a good pace
|
// 1.2^x seems to be a good value to exponentially increase time at a good pace
|
||||||
// eg. 1.2^32 = 341 seconds ~= 5 minutes - ie. after 32 retries we wait 5
|
// eg. 1.2^32 = 341 seconds ~= 5 minutes - ie. after 32 retries we wait 5
|
||||||
// minutes
|
// minutes
|
||||||
return Duration::from_secs(cmp::min(
|
Duration::from_secs(cmp::min(
|
||||||
max_time.as_secs(),
|
max_time.as_secs(),
|
||||||
1.2f64.powf(retries as f64) as u64,
|
1.2f64.powf(retries as f64) as u64,
|
||||||
));
|
))
|
||||||
}
|
}
|
||||||
|
|
||||||
fn parse_tricot_tag(
|
fn parse_tricot_tag(
|
||||||
|
|
|
@ -135,7 +135,7 @@ pub async fn call(
|
||||||
forward_uri: &str,
|
forward_uri: &str,
|
||||||
request: Request<Body>,
|
request: Request<Body>,
|
||||||
) -> Result<Response<Body>> {
|
) -> Result<Response<Body>> {
|
||||||
let proxied_request = create_proxied_request(client_ip, &forward_uri, request)?;
|
let proxied_request = create_proxied_request(client_ip, forward_uri, request)?;
|
||||||
|
|
||||||
trace!("Proxied request: {:?}", proxied_request);
|
trace!("Proxied request: {:?}", proxied_request);
|
||||||
|
|
||||||
|
@ -153,7 +153,7 @@ pub async fn call_https(
|
||||||
forward_uri: &str,
|
forward_uri: &str,
|
||||||
request: Request<Body>,
|
request: Request<Body>,
|
||||||
) -> Result<Response<Body>> {
|
) -> Result<Response<Body>> {
|
||||||
let proxied_request = create_proxied_request(client_ip, &forward_uri, request)?;
|
let proxied_request = create_proxied_request(client_ip, forward_uri, request)?;
|
||||||
|
|
||||||
trace!("Proxied request (HTTPS): {:?}", proxied_request);
|
trace!("Proxied request (HTTPS): {:?}", proxied_request);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue