fix incompatible deps

This commit is contained in:
mpostma 2021-01-04 17:38:09 +01:00
parent 48eb78b14d
commit 83ea088bf7
No known key found for this signature in database
GPG key ID: CBC8A7C1D7A28C3A
3 changed files with 26 additions and 31 deletions

View file

@ -40,7 +40,7 @@ mime = "0.3.16"
once_cell = "1.5.2"
rand = "0.8.1"
regex = "1.4.2"
rustls = "0.19.0"
rustls = "0.18.0"
serde = { version = "1.0.118", features = ["derive"] }
serde_json = { version = "1.0.61", features = ["preserve_order"] }
serde_qs = "0.8.2"
@ -50,7 +50,7 @@ slice-group-by = "0.2.6"
structopt = "0.3.21"
tar = "0.4.30"
tempfile = "3.1.0"
tokio = { version = "1.0.1", features = ["macros"] }
tokio = { version = "0.2", features = ["macros"] }
ureq = { version = "2.0.0", features = ["tls"], default-features = false }
walkdir = "2.3.1"
whoami = "1.0.3"
@ -73,7 +73,7 @@ optional = true
[dev-dependencies]
serde_url_params = "0.2.0"
tempdir = "0.3.7"
tokio = { version = "1.0.1", features = ["macros", "time"] }
tokio = { version = "0.2", features = ["macros", "time"] }
[dev-dependencies.assert-json-diff]
git = "https://github.com/qdequele/assert-json-diff"

View file

@ -127,9 +127,14 @@ pub fn analytics_sender(data: Data, opt: Opt) {
let body = qs::to_string(&request).unwrap();
let response = ureq::post("https://api.amplitude.com/httpapi").send_string(&body);
if !response.ok() {
let body = response.into_string().unwrap();
error!("Unsuccessful call to Amplitude: {}", body);
match response {
Err(ureq::Error::Status(_ , response)) => {
error!("Unsuccessful call to Amplitude: {}", response.into_string().unwrap_or_default());
}
Err(e) => {
error!("Unsuccessful call to Amplitude: {}", e);
}
_ => (),
}
thread::sleep(Duration::from_secs(3600)) // one hour