aboutsummaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
Diffstat (limited to 'src/util')
-rw-r--r--src/util/Cargo.toml15
-rw-r--r--src/util/background.rs6
-rw-r--r--src/util/data.rs4
3 files changed, 10 insertions, 15 deletions
diff --git a/src/util/Cargo.toml b/src/util/Cargo.toml
index 2ae4796c..4698a04f 100644
--- a/src/util/Cargo.toml
+++ b/src/util/Cargo.toml
@@ -13,31 +13,26 @@ path = "lib.rs"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
-rand = "0.7"
-hex = "0.3"
-sha2 = "0.8"
+rand = "0.8"
+hex = "0.4"
+sha2 = "0.9"
blake2 = "0.9"
-err-derive = "0.2.3"
+err-derive = "0.3"
log = "0.4"
fasthash = "0.4"
sled = "0.34"
toml = "0.5"
-rmp-serde = "0.14.3"
+rmp-serde = "0.15"
serde = { version = "1.0", default-features = false, features = ["derive", "rc"] }
serde_json = "1.0"
chrono = "0.4"
-arc-swap = "1.2"
futures = "0.3"
-futures-util = "0.3"
tokio = { version = "1.0", default-features = false, features = ["rt", "rt-multi-thread", "io-util", "net", "time", "macros", "sync", "signal", "fs"] }
http = "0.2"
hyper = "0.14"
rustls = "0.19"
webpki = "0.21"
-
-roxmltree = "0.11"
-
diff --git a/src/util/background.rs b/src/util/background.rs
index 35d41d9f..b5eb8bc8 100644
--- a/src/util/background.rs
+++ b/src/util/background.rs
@@ -37,7 +37,7 @@ impl BackgroundRunner {
None => break,
}
}
- _ = tokio::time::sleep(Duration::from_secs(10)).fuse() => {
+ _ = tokio::time::sleep(Duration::from_secs(5)).fuse() => {
if *stop_signal_2.borrow() {
break;
} else {
@@ -71,9 +71,9 @@ impl BackgroundRunner {
// because the sending side was dropped. Exit now.
None => break,
},
- _ = tokio::time::sleep(Duration::from_secs(10)).fuse() => {
+ _ = tokio::time::sleep(Duration::from_secs(5)).fuse() => {
if *stop_signal.borrow() {
- // Nothing has been going on for 10 secs, and we are shutting
+ // Nothing has been going on for 5 secs, and we are shutting
// down. Exit now.
break;
} else {
diff --git a/src/util/data.rs b/src/util/data.rs
index 591b7605..cb784730 100644
--- a/src/util/data.rs
+++ b/src/util/data.rs
@@ -87,9 +87,9 @@ pub fn sha256sum(data: &[u8]) -> Hash {
use sha2::{Digest, Sha256};
let mut hasher = Sha256::new();
- hasher.input(data);
+ hasher.update(data);
let mut hash = [0u8; 32];
- hash.copy_from_slice(&hasher.result()[..]);
+ hash.copy_from_slice(&hasher.finalize()[..]);
hash.into()
}