Update everything to Tokio v1.

This commit is contained in:
Syfaro 2021-02-20 21:16:58 -05:00
parent 8914227f23
commit 4ad577cee5
5 changed files with 122 additions and 738 deletions

834
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -5,14 +5,14 @@ authors = ["Syfaro <syfaro@huefox.com>"]
edition = "2018" edition = "2018"
[dependencies] [dependencies]
reqwest = "0.10" reqwest = "0.11"
postgres = { version = "0.18.0", features = ["with-chrono-0_4"] } postgres = { version = "0.19", features = ["with-chrono-0_4"] }
tokio = { version = "0.2", features = ["full"] } tokio = { version = "1", features = ["full"] }
tokio-postgres = { version = "0.5.0" } tokio-postgres = { version = "0.7.0" }
r2d2_postgres = " 0.16.0" r2d2_postgres = " 0.18.0"
r2d2 = "0.8" r2d2 = "0.8"
chrono = "0.4" chrono = "0.4"
hyper = "0.13" hyper = "0.14"
prometheus = { version = "0.11", features = ["process"] } prometheus = { version = "0.11", features = ["process"] }
lazy_static = "1" lazy_static = "1"

View File

@ -190,7 +190,7 @@ async fn main() {
println!("got error: {:?}, retry {}", e.message, e.retry); println!("got error: {:?}, retry {}", e.message, e.retry);
timer.stop_and_discard(); timer.stop_and_discard();
if e.retry { if e.retry {
tokio::time::delay_for(std::time::Duration::from_secs(attempt + 1)) tokio::time::sleep(std::time::Duration::from_secs(attempt + 1))
.await; .await;
continue 'attempt; continue 'attempt;
} else { } else {
@ -231,6 +231,6 @@ async fn main() {
println!("completed fetch, waiting a minute before loading more"); println!("completed fetch, waiting a minute before loading more");
tokio::time::delay_for(std::time::Duration::from_secs(60)).await; tokio::time::sleep(std::time::Duration::from_secs(60)).await;
} }
} }

View File

@ -7,8 +7,8 @@ edition = "2018"
[dependencies] [dependencies]
anyhow = "1" anyhow = "1"
reqwest = { version = "0.10", features = ["json"] } reqwest = { version = "0.11", features = ["json"] }
tokio = { version = "0.2", features = ["full"] } tokio = { version = "1", features = ["full"] }
serde = "1" serde = "1"
serde_json = "1" serde_json = "1"
@ -21,6 +21,6 @@ sha2 = "0.9"
fuzzysearch-common = { path = "../fuzzysearch-common" } fuzzysearch-common = { path = "../fuzzysearch-common" }
[dependencies.sqlx] [dependencies.sqlx]
version = "0.4" version = "0.5"
default-features = false default-features = false
features = ["runtime-tokio-rustls", "macros", "postgres", "json", "offline"] features = ["runtime-tokio-native-tls", "macros", "postgres", "json", "offline"]

View File

@ -208,6 +208,6 @@ async fn main() {
} }
} }
tokio::time::delay_for(std::time::Duration::from_secs(60 * 5)).await; tokio::time::sleep(std::time::Duration::from_secs(60 * 5)).await;
} }
} }