From 49b74b587a774de5dd21891864198e2d9d5a69af Mon Sep 17 00:00:00 2001 From: mpostma Date: Fri, 12 Mar 2021 17:44:39 +0100 Subject: [PATCH] enable jemalloc only on linux --- meilisearch-http/Cargo.toml | 2 +- meilisearch-http/src/index_controller/mod.rs | 16 +++------------- .../src/index_controller/update_actor.rs | 2 -- meilisearch-http/src/lib.rs | 5 ----- 4 files changed, 4 insertions(+), 21 deletions(-) diff --git a/meilisearch-http/Cargo.toml b/meilisearch-http/Cargo.toml index 7b09b3042..e88556f0a 100644 --- a/meilisearch-http/Cargo.toml +++ b/meilisearch-http/Cargo.toml @@ -81,5 +81,5 @@ urlencoding = "1.1.1" [features] default = ["sentry"] -[target.'cfg(unix)'.dependencies] +[target.'cfg(target_os = "linux")'.dependencies] jemallocator = "0.3.2" diff --git a/meilisearch-http/src/index_controller/mod.rs b/meilisearch-http/src/index_controller/mod.rs index 1433562ff..5dc3374a0 100644 --- a/meilisearch-http/src/index_controller/mod.rs +++ b/meilisearch-http/src/index_controller/mod.rs @@ -14,9 +14,8 @@ use actix_web::web::{Bytes, Payload}; use futures::stream::StreamExt; use milli::update::{IndexDocumentsMethod, UpdateFormat}; use serde::{Serialize, Deserialize}; -use tokio::sync::{mpsc, oneshot}; +use tokio::sync::mpsc; use tokio::time::sleep; -use uuid::Uuid; pub use updates::{Processed, Processing, Failed}; use crate::index::{SearchResult, SearchQuery, Document}; @@ -59,15 +58,6 @@ pub struct IndexController { update_handle: update_actor::UpdateActorHandle, } -enum IndexControllerMsg { - CreateIndex { - uuid: Uuid, - primary_key: Option, - ret: oneshot::Sender>, - }, - Shutdown, -} - impl IndexController { pub fn new(path: impl AsRef) -> anyhow::Result { let uuid_resolver = uuid_resolver::UuidResolverHandle::new(&path)?; @@ -94,10 +84,10 @@ impl IndexController { tokio::task::spawn_local(async move { while let Some(bytes) = payload.next().await { match bytes { - Ok(bytes) => { sender.send(Ok(bytes)).await; }, + Ok(bytes) => { let _ = sender.send(Ok(bytes)).await; }, Err(e) => { let error: Box = Box::new(e); - sender.send(Err(error)).await; }, + let _ = sender.send(Err(error)).await; }, } } }); diff --git a/meilisearch-http/src/index_controller/update_actor.rs b/meilisearch-http/src/index_controller/update_actor.rs index 2c16eb60b..0eb473065 100644 --- a/meilisearch-http/src/index_controller/update_actor.rs +++ b/meilisearch-http/src/index_controller/update_actor.rs @@ -144,8 +144,6 @@ where .await .map_err(|e| UpdateError::Error(Box::new(e)))?; - let file = file.into_std().await; - tokio::task::spawn_blocking(move || { let result = update_store .register_update(meta, path, uuid) diff --git a/meilisearch-http/src/lib.rs b/meilisearch-http/src/lib.rs index bd7379d7c..da1aee746 100644 --- a/meilisearch-http/src/lib.rs +++ b/meilisearch-http/src/lib.rs @@ -1,8 +1,3 @@ -#![allow(clippy::or_fun_call)] -#![allow(unused_must_use)] -#![allow(unused_variables)] -#![allow(dead_code)] - pub mod data; pub mod error; pub mod helpers;