mirror of https://github.com/MingweiSamuel/Riven
Upgrade to reqwest 0.11, tokio 1.0
parent
4782ba48b3
commit
20b8d49b89
20
Cargo.toml
20
Cargo.toml
|
@ -25,19 +25,19 @@ nightly = [ "parking_lot/nightly" ]
|
||||||
[dependencies]
|
[dependencies]
|
||||||
lazy_static = "1.4"
|
lazy_static = "1.4"
|
||||||
log = "0.4"
|
log = "0.4"
|
||||||
num_enum = "0.4"
|
num_enum = "0.5"
|
||||||
parking_lot = "0.10"
|
parking_lot = "0.11"
|
||||||
reqwest = { version = "0.10", features = [ "gzip", "json" ] }
|
reqwest = { version = "0.11", features = [ "gzip", "json" ] }
|
||||||
scan_fmt = { version = "0.2", default-features = false }
|
scan_fmt = { version = "0.2", default-features = false }
|
||||||
serde = { version = "1.0", features = [ "derive" ] }
|
serde = { version = "1.0", features = [ "derive" ] }
|
||||||
serde_repr = "0.1"
|
serde_repr = "0.1"
|
||||||
strum = "0.17"
|
strum = "0.20"
|
||||||
strum_macros = "0.17"
|
strum_macros = "0.20"
|
||||||
tokio = { version = "0.2", default-features = false, features = [ "time" ] }
|
tokio = { version = "1", default-features = false, features = [ "time" ] }
|
||||||
url = "2.1"
|
url = "2"
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
colored = "1.8"
|
colored = "2"
|
||||||
env_logger = "0.7"
|
env_logger = "0.8"
|
||||||
fake_instant = "0.4"
|
fake_instant = "0.4"
|
||||||
tokio = "0.2"
|
tokio = { version = "1", default-features = false, features = [ "rt-multi-thread" ] }
|
||||||
|
|
|
@ -3,7 +3,6 @@ use std::sync::Arc;
|
||||||
|
|
||||||
use log;
|
use log;
|
||||||
use reqwest::{ Client, StatusCode, Url };
|
use reqwest::{ Client, StatusCode, Url };
|
||||||
use tokio::time::delay_for;
|
|
||||||
|
|
||||||
use crate::Result;
|
use crate::Result;
|
||||||
use crate::ResponseInfo;
|
use crate::ResponseInfo;
|
||||||
|
@ -54,7 +53,7 @@ impl RegionalRequester {
|
||||||
|
|
||||||
// Rate limiting.
|
// Rate limiting.
|
||||||
while let Some(delay) = RateLimit::get_both_or_delay(&self.app_rate_limit, &*method_rate_limit) {
|
while let Some(delay) = RateLimit::get_both_or_delay(&self.app_rate_limit, &*method_rate_limit) {
|
||||||
delay_for(delay).await;
|
tokio::time::sleep(delay).await;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Send request.
|
// Send request.
|
||||||
|
|
|
@ -7,7 +7,7 @@ macro_rules! async_tests {
|
||||||
env_logger::init();
|
env_logger::init();
|
||||||
|
|
||||||
std::process::exit({
|
std::process::exit({
|
||||||
let mut rt = tokio::runtime::Runtime::new()
|
let rt = tokio::runtime::Runtime::new()
|
||||||
.expect("Failed to create runtime.");
|
.expect("Failed to create runtime.");
|
||||||
|
|
||||||
let (_, errs) = rt.block_on(async {
|
let (_, errs) = rt.block_on(async {
|
||||||
|
|
Loading…
Reference in New Issue