Update dependencies (reqwest 0.11 and tokio 1.0) (#51)

Co-authored-by: dependabot-preview[bot] <27856297+dependabot-preview[bot]@users.noreply.github.com>
Co-authored-by: Matthias Endler <matthias-endler@gmx.net>
This commit is contained in:
dependabot-preview[bot] 2021-01-07 00:10:58 +01:00 committed by GitHub
parent 745c34f9ce
commit a3ad492c0b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 277 additions and 608 deletions

836
Cargo.lock generated

File diff suppressed because it is too large Load diff

View file

@ -18,42 +18,42 @@ version = "0.4.1"
[dependencies]
anyhow = "1.0.37"
futures = "0.3"
glob = "0.3"
http = "0.2"
hubcaps = "0.6"
futures = "0.3.8"
glob = "0.3.0"
http = "0.2.2"
hubcaps = "0.6.2"
linkify = "0.4.0"
regex = "1.4.2"
url = "2.2.0"
check-if-email-exists = "0.8.17"
indicatif = "0.15.0"
structopt = "0.3"
structopt = "0.3.21"
toml = "0.5.8"
serde = { version = "1.0", features = ["derive"] }
serde = { version = "1.0.118", features = ["derive"] }
pulldown-cmark = "0.8.0"
quick-xml = "0.20.0"
headers = "0.3.2"
derive_builder = "0.9.0"
deadpool = "0.7.0"
shellexpand = "2.1"
lazy_static = "1.1"
wiremock = "0.3.0"
openssl-sys = "0.9.60"
shellexpand = "2.1.0"
lazy_static = "1.4.0"
wiremock = "0.4.3"
openssl-sys = "0.9.60"
serde_json = "1.0.61"
[dependencies.reqwest]
features = ["gzip"]
version = "0.10"
version = "0.11.0"
[dependencies.tokio]
features = ["full"]
version = "0.2"
version = "1.0.1"
[dev-dependencies]
assert_cmd = "1.0"
predicates = "1.0"
uuid = { version = "0.8", features = ["v4"] }
tempfile = "3.1"
assert_cmd = "1.0.2"
predicates = "1.0.6"
uuid = { version = "0.8.1", features = ["v4"] }
tempfile = "3.1.0"
[features]
vendored-openssl = ["openssl-sys/vendored"]

View file

@ -38,12 +38,11 @@ fn main() -> Result<()> {
}
let cfg = &opts.config;
let mut runtime = match cfg.threads {
let runtime = match cfg.threads {
Some(threads) => {
// We define our own runtime instead of the `tokio::main` attribute since we want to make the number of threads configurable
tokio::runtime::Builder::new()
.threaded_scheduler()
.core_threads(threads)
tokio::runtime::Builder::new_multi_thread()
.worker_threads(threads)
.enable_all()
.build()?
}
@ -125,7 +124,7 @@ async fn run(cfg: &Config, inputs: Vec<Input>) -> Result<i32> {
None
};
let (mut send_req, recv_req) = mpsc::channel(max_concurrency);
let (send_req, recv_req) = mpsc::channel(max_concurrency);
let (send_resp, mut recv_resp) = mpsc::channel(max_concurrency);
let mut stats = ResponseStats::new();

View file

@ -7,7 +7,7 @@ use regex::{Regex, RegexSet};
use reqwest::header;
use std::net::IpAddr;
use std::{collections::HashSet, time::Duration};
use tokio::time::delay_for;
use tokio::time::sleep;
use url::Url;
use crate::excludes::Excludes;
@ -196,7 +196,7 @@ impl Client {
false => {
if retries > 0 {
retries -= 1;
delay_for(Duration::from_secs(wait)).await;
sleep(Duration::from_secs(wait)).await;
wait *= 2;
} else {
break res;

View file

@ -24,7 +24,7 @@ impl ClientPool {
pub async fn listen(&mut self) {
while let Some(req) = self.rx.recv().await {
let client = self.pool.get().await;
let mut tx = self.tx.clone();
let tx = self.tx.clone();
tokio::spawn(async move {
let resp = client.check(req).await;
tx.send(resp).await.unwrap();

View file

@ -189,7 +189,7 @@ pub async fn collect_links(
// extract input contents
for input in inputs.iter().cloned() {
let mut sender = contents_tx.clone();
let sender = contents_tx.clone();
tokio::spawn(async move {
let contents = input.get_contents(None, skip_missing_inputs).await;