Merge pull request #138 from maximebedard/bump-tokio-0-3

Bump to tokio 1.0 and hyper 0.14
This commit is contained in:
Lewin Bormann
2020-12-27 09:05:14 +01:00
committed by GitHub
8 changed files with 17 additions and 16 deletions

View File

@@ -466,7 +466,7 @@ impl HyperClientBuilder for DefaultHyperClient {
fn build_hyper_client(self) -> hyper::Client<Self::Connector> {
hyper::Client::builder()
.pool_max_idle_per_host(0)
.build::<_, hyper::Body>(hyper_rustls::HttpsConnector::new())
.build::<_, hyper::Body>(hyper_rustls::HttpsConnector::with_native_roots())
}
}

View File

@@ -80,7 +80,7 @@ impl DeviceFlow {
let mut interval = device_auth_resp.interval;
log::debug!("Polling every {:?} for device token", interval);
loop {
tokio::time::delay_for(interval).await;
tokio::time::sleep(interval).await;
interval = match Self::poll_token(
&app_secret,
hyper_client,

View File

@@ -225,9 +225,9 @@ mod tests {
.await
.unwrap();
let acc = ServiceAccountFlow::new(ServiceAccountFlowOpts { key, subject: None }).unwrap();
let https = HttpsConnector::new();
let https = HttpsConnector::with_native_roots();
let client = hyper::Client::builder()
.keep_alive(false)
.pool_max_idle_per_host(0)
.build::<_, hyper::Body>(https);
println!(
"{:?}",