Skip to content
Snippets Groups Projects
Commit 24ed0aad authored by Éloïs's avatar Éloïs
Browse files

[deps] upgrade tokio to v1

parent 98e66cc6
No related branches found
No related tags found
No related merge requests found
......@@ -1198,7 +1198,7 @@ dependencies = [
"serde",
"serde_json",
"serde_urlencoded",
"tokio 0.2.22",
"tokio",
"unwrap",
"warp",
]
......@@ -1257,7 +1257,7 @@ dependencies = [
"resiter",
"serde",
"serde_json",
"tokio 0.2.22",
"tokio",
"unwrap",
]
......@@ -1293,7 +1293,7 @@ dependencies = [
"log",
"paste",
"resiter",
"tokio 0.2.22",
"tokio",
]
[[package]]
......@@ -1337,7 +1337,7 @@ dependencies = [
"duniter-mempools",
"fast-threadpool",
"paste",
"tokio 0.2.22",
"tokio",
]
[[package]]
......@@ -1359,7 +1359,7 @@ dependencies = [
"log",
"paste",
"resiter",
"tokio 0.2.22",
"tokio",
]
[[package]]
......@@ -1783,7 +1783,7 @@ dependencies = [
"http",
"indexmap",
"slab",
"tokio 1.2.0",
"tokio",
"tokio-util",
"tracing",
"tracing-futures",
......@@ -1911,7 +1911,7 @@ dependencies = [
"itoa",
"pin-project 1.0.1",
"socket2",
"tokio 1.2.0",
"tokio",
"tower-service",
"tracing",
"want",
......@@ -3701,20 +3701,6 @@ version = "0.3.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "238ce071d267c5710f9d31451efec16c5ee22de34df17cc05e56cbc92e967117"
[[package]]
name = "tokio"
version = "0.2.22"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "5d34ca54d84bf2b5b4d7d31e901a8464f7b60ac145a284fba25ceb801f2ddccd"
dependencies = [
"bytes 0.5.6",
"memchr",
"num_cpus",
"pin-project-lite 0.1.11",
"slab",
"tokio-macros",
]
[[package]]
name = "tokio"
version = "1.2.0"
......@@ -3726,14 +3712,16 @@ dependencies = [
"libc",
"memchr",
"mio",
"num_cpus",
"pin-project-lite 0.2.0",
"tokio-macros",
]
[[package]]
name = "tokio-macros"
version = "0.2.6"
version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e44da00bfc73a25f814cd8d7e57a68a5c31b74b3152a0a1d1f590c97ed06265a"
checksum = "caf7b11a536f46a809a8a9f0bb4237020f70ecbf115b842360afb127ea2fda57"
dependencies = [
"proc-macro2",
"quote",
......@@ -3748,7 +3736,7 @@ checksum = "1981ad97df782ab506a1f43bf82c967326960d278acf3bf8279809648c3ff3ea"
dependencies = [
"futures-core",
"pin-project-lite 0.2.0",
"tokio 1.2.0",
"tokio",
]
[[package]]
......@@ -3760,7 +3748,7 @@ dependencies = [
"futures-util",
"log",
"pin-project 1.0.1",
"tokio 1.2.0",
"tokio",
"tungstenite",
]
......@@ -3775,7 +3763,7 @@ dependencies = [
"futures-sink",
"log",
"pin-project-lite 0.2.0",
"tokio 1.2.0",
"tokio",
]
[[package]]
......@@ -4076,7 +4064,7 @@ dependencies = [
"serde",
"serde_json",
"serde_urlencoded",
"tokio 1.2.0",
"tokio",
"tokio-stream",
"tokio-tungstenite",
"tokio-util",
......
......@@ -17,4 +17,4 @@ fast-threadpool = "0.2.3"
[dev-dependencies]
duniter-dbs = { path = "../duniter-dbs", features = ["mem"] }
paste = "1.0.2"
tokio = { version = "0.2.22", features = ["macros", "rt-core"] }
tokio = { version = "1.2", features = ["macros", "rt"] }
......@@ -21,7 +21,7 @@ flume = "0.10.0"
log = "0.4.11"
paste = "1.0.2"
resiter = "0.4.0"
tokio = { version = "0.2.22", features = ["io-util", "rt-threaded"] }
tokio = { version = "1.2", features = ["io-util", "rt-multi-thread"] }
[features]
default = ["gva"]
......
......@@ -129,8 +129,7 @@ impl DuniterServer {
fast_threadpool::ThreadPool::start(ThreadPoolConfig::default(), shared_dbs.clone());
if command != DuniterCommand::Sync && conf.gva.is_some() {
let mut runtime = tokio::runtime::Builder::new()
.threaded_scheduler()
let runtime = tokio::runtime::Builder::new_multi_thread()
.enable_all()
.build()?;
let conf_clone = conf.clone();
......
......@@ -28,12 +28,12 @@ log = "0.4.11"
resiter = "0.4.0"
serde = { version = "1.0.105", features = ["derive"] }
serde_urlencoded = "0.7.0"
tokio = { version = "0.2.22", features = ["io-util", "rt-threaded"] }
tokio = { version = "1.2", features = ["io-util", "rt-multi-thread"] }
warp = "0.3"
[dev-dependencies]
duniter-dbs = { path = "../../duniter-dbs", features = ["mem"] }
mockall = "0.8.0"
serde_json = "1.0.53"
tokio = { version = "0.2.22", features = ["macros", "rt-threaded", "time"] }
tokio = { version = "1.2", features = ["macros", "rt-multi-thread", "time"] }
unwrap = "1.2.1"
......@@ -29,5 +29,5 @@ serde = { version = "1.0.105", features = ["derive"] }
duniter-dbs = { path = "../../../duniter-dbs", features = ["mem"] }
mockall = "0.8.0"
serde_json = "1.0.53"
tokio = { version = "0.2.22", features = ["macros", "rt-threaded", "time"] }
tokio = { version = "1.2", features = ["macros", "rt-multi-thread", "time"] }
unwrap = "1.2.1"
......@@ -123,7 +123,6 @@ impl AntiSpam {
mod tests {
use super::*;
use std::net::{Ipv4Addr, Ipv6Addr};
use tokio::time::delay_for;
const LOCAL_IP4: IpAddr = IpAddr::V4(Ipv4Addr::LOCALHOST);
const LOCAL_IP6: IpAddr = IpAddr::V6(Ipv6Addr::LOCALHOST);
......@@ -148,16 +147,16 @@ mod tests {
assert!(!anti_spam.verify(Some(extern_ip)).await);
// Should be un-banned after one second
delay_for(Duration::from_millis(1_100)).await;
tokio::time::sleep(Duration::from_millis(1_100)).await;
// Re-consume max queries
for _ in 0..COUNT_INTERVAL {
assert!(anti_spam.verify(Some(extern_ip)).await);
}
// Should be banned for 2 seconds this time
delay_for(Duration::from_millis(1_100)).await;
tokio::time::sleep(Duration::from_millis(1_100)).await;
// Attempting a request when I'm banned must be twice my banning time
assert!(!anti_spam.verify(Some(extern_ip)).await);
delay_for(Duration::from_millis(4_100)).await;
tokio::time::sleep(Duration::from_millis(4_100)).await;
// Re-consume max queries
for _ in 0..COUNT_INTERVAL {
assert!(anti_spam.verify(Some(extern_ip)).await);
......
......@@ -20,4 +20,4 @@ flume = "0.10.0"
log = "0.4.11"
paste = "1.0.2"
resiter = "0.4.0"
tokio = { version = "0.2.22", features = ["io-util", "rt-threaded"] }
tokio = { version = "1.2", features = ["io-util", "rt-multi-thread"] }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment