mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-03 11:57:07 +02:00
Replace isahc by ureq
This commit is contained in:
parent
6d686ac14f
commit
83ad80d9db
3 changed files with 182 additions and 148 deletions
|
@ -19,7 +19,6 @@ env_logger = "0.7.1"
|
|||
heed = "0.6.0"
|
||||
http = "0.1.19"
|
||||
indexmap = { version = "1.3.0", features = ["serde-1"] }
|
||||
isahc = "0.7.6"
|
||||
log = "0.4.8"
|
||||
main_error = "0.1.0"
|
||||
meilisearch-core = { path = "../meilisearch-core", version = "0.8.1" }
|
||||
|
@ -33,6 +32,7 @@ serde_qs = "0.5.1"
|
|||
siphasher = "0.3.1"
|
||||
structopt = "0.3.3"
|
||||
sysinfo = "0.9.5"
|
||||
ureq = { version = "0.11.2", features = ["tls"], default-features = false }
|
||||
walkdir = "2.2.9"
|
||||
whoami = "0.6"
|
||||
|
||||
|
|
|
@ -58,14 +58,10 @@ pub fn analytics_sender() {
|
|||
};
|
||||
|
||||
let body = qs::to_string(&request).unwrap();
|
||||
match isahc::post("https://api.amplitude.com/httpapi", body) {
|
||||
Ok(response) => {
|
||||
if !response.status().is_success() {
|
||||
let body = response.into_body().text().unwrap();
|
||||
error!("Unsuccessful call to Amplitude: {}", body);
|
||||
}
|
||||
}
|
||||
Err(e) => error!("Error while sending a request to Amplitude: {}", e),
|
||||
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);
|
||||
}
|
||||
|
||||
thread::sleep(Duration::from_secs(86_400)) // one day
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue