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

@ -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