diff --git a/meilisearch-http/src/lib.rs b/meilisearch-http/src/lib.rs index 2169bdb37..858f49924 100644 --- a/meilisearch-http/src/lib.rs +++ b/meilisearch-http/src/lib.rs @@ -30,7 +30,7 @@ pub fn setup_meilisearch(opt: &Opt) -> anyhow::Result { let mut meilisearch = MeiliSearch::builder(); // disable autobatching? - let _ = AUTOBATCHING_ENABLED.store( + AUTOBATCHING_ENABLED.store( opt.scheduler_options.disable_auto_batching, std::sync::atomic::Ordering::Relaxed, ); diff --git a/meilisearch-lib/src/dump/error.rs b/meilisearch-lib/src/dump/error.rs index 3f6e2aae5..679fa2bc2 100644 --- a/meilisearch-lib/src/dump/error.rs +++ b/meilisearch-lib/src/dump/error.rs @@ -11,7 +11,7 @@ pub enum DumpError { #[error("An internal error has occurred. `{0}`.")] Internal(Box), #[error("{0}")] - IndexResolver(#[from] IndexResolverError), + IndexResolver(Box), } internal_error!( @@ -26,6 +26,12 @@ internal_error!( TaskError ); +impl From for DumpError { + fn from(e: IndexResolverError) -> Self { + Self::IndexResolver(Box::new(e)) + } +} + impl ErrorCode for DumpError { fn error_code(&self) -> Code { match self { diff --git a/meilisearch-lib/src/tasks/scheduler.rs b/meilisearch-lib/src/tasks/scheduler.rs index a709f566e..c7a522c96 100644 --- a/meilisearch-lib/src/tasks/scheduler.rs +++ b/meilisearch-lib/src/tasks/scheduler.rs @@ -484,7 +484,7 @@ fn make_batch(tasks: &mut TaskQueue, config: &SchedulerConfig) -> Processing { match list.peek() { Some(pending) if pending.kind == kind => { // We always need to process at least one task for the scheduler to make progress. - if config.disable_auto_batching && task_list.len() > 0 { + if config.disable_auto_batching && !task_list.is_empty() { break; } let pending = list.pop().unwrap();