enable jemalloc only on linux

This commit is contained in:
mpostma 2021-03-12 17:44:39 +01:00
parent c61fab1435
commit 49b74b587a
No known key found for this signature in database
GPG Key ID: CBC8A7C1D7A28C3A
4 changed files with 4 additions and 21 deletions

View File

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

View File

@ -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<Bytes>,
}
enum IndexControllerMsg {
CreateIndex {
uuid: Uuid,
primary_key: Option<String>,
ret: oneshot::Sender<anyhow::Result<IndexMetadata>>,
},
Shutdown,
}
impl IndexController {
pub fn new(path: impl AsRef<Path>) -> anyhow::Result<Self> {
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<dyn std::error::Error + Sync + Send + 'static> = Box::new(e);
sender.send(Err(error)).await; },
let _ = sender.send(Err(error)).await; },
}
}
});

View File

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

View File

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