mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-04 12:27:13 +02:00
Replace isahc by ureq
This commit is contained in:
parent
6d686ac14f
commit
83ad80d9db
3 changed files with 182 additions and 148 deletions
|
@ -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