mirror of
https://github.com/meilisearch/meilisearch.git
synced 2025-01-19 01:18:31 +08:00
enable jemalloc only on linux
This commit is contained in:
parent
c61fab1435
commit
49b74b587a
@ -81,5 +81,5 @@ urlencoding = "1.1.1"
|
|||||||
[features]
|
[features]
|
||||||
default = ["sentry"]
|
default = ["sentry"]
|
||||||
|
|
||||||
[target.'cfg(unix)'.dependencies]
|
[target.'cfg(target_os = "linux")'.dependencies]
|
||||||
jemallocator = "0.3.2"
|
jemallocator = "0.3.2"
|
||||||
|
@ -14,9 +14,8 @@ use actix_web::web::{Bytes, Payload};
|
|||||||
use futures::stream::StreamExt;
|
use futures::stream::StreamExt;
|
||||||
use milli::update::{IndexDocumentsMethod, UpdateFormat};
|
use milli::update::{IndexDocumentsMethod, UpdateFormat};
|
||||||
use serde::{Serialize, Deserialize};
|
use serde::{Serialize, Deserialize};
|
||||||
use tokio::sync::{mpsc, oneshot};
|
use tokio::sync::mpsc;
|
||||||
use tokio::time::sleep;
|
use tokio::time::sleep;
|
||||||
use uuid::Uuid;
|
|
||||||
|
|
||||||
pub use updates::{Processed, Processing, Failed};
|
pub use updates::{Processed, Processing, Failed};
|
||||||
use crate::index::{SearchResult, SearchQuery, Document};
|
use crate::index::{SearchResult, SearchQuery, Document};
|
||||||
@ -59,15 +58,6 @@ pub struct IndexController {
|
|||||||
update_handle: update_actor::UpdateActorHandle<Bytes>,
|
update_handle: update_actor::UpdateActorHandle<Bytes>,
|
||||||
}
|
}
|
||||||
|
|
||||||
enum IndexControllerMsg {
|
|
||||||
CreateIndex {
|
|
||||||
uuid: Uuid,
|
|
||||||
primary_key: Option<String>,
|
|
||||||
ret: oneshot::Sender<anyhow::Result<IndexMetadata>>,
|
|
||||||
},
|
|
||||||
Shutdown,
|
|
||||||
}
|
|
||||||
|
|
||||||
impl IndexController {
|
impl IndexController {
|
||||||
pub fn new(path: impl AsRef<Path>) -> anyhow::Result<Self> {
|
pub fn new(path: impl AsRef<Path>) -> anyhow::Result<Self> {
|
||||||
let uuid_resolver = uuid_resolver::UuidResolverHandle::new(&path)?;
|
let uuid_resolver = uuid_resolver::UuidResolverHandle::new(&path)?;
|
||||||
@ -94,10 +84,10 @@ impl IndexController {
|
|||||||
tokio::task::spawn_local(async move {
|
tokio::task::spawn_local(async move {
|
||||||
while let Some(bytes) = payload.next().await {
|
while let Some(bytes) = payload.next().await {
|
||||||
match bytes {
|
match bytes {
|
||||||
Ok(bytes) => { sender.send(Ok(bytes)).await; },
|
Ok(bytes) => { let _ = sender.send(Ok(bytes)).await; },
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
let error: Box<dyn std::error::Error + Sync + Send + 'static> = Box::new(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; },
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -144,8 +144,6 @@ where
|
|||||||
.await
|
.await
|
||||||
.map_err(|e| UpdateError::Error(Box::new(e)))?;
|
.map_err(|e| UpdateError::Error(Box::new(e)))?;
|
||||||
|
|
||||||
let file = file.into_std().await;
|
|
||||||
|
|
||||||
tokio::task::spawn_blocking(move || {
|
tokio::task::spawn_blocking(move || {
|
||||||
let result = update_store
|
let result = update_store
|
||||||
.register_update(meta, path, uuid)
|
.register_update(meta, path, uuid)
|
||||||
|
@ -1,8 +1,3 @@
|
|||||||
#![allow(clippy::or_fun_call)]
|
|
||||||
#![allow(unused_must_use)]
|
|
||||||
#![allow(unused_variables)]
|
|
||||||
#![allow(dead_code)]
|
|
||||||
|
|
||||||
pub mod data;
|
pub mod data;
|
||||||
pub mod error;
|
pub mod error;
|
||||||
pub mod helpers;
|
pub mod helpers;
|
||||||
|
Loading…
Reference in New Issue
Block a user