diff --git a/index-scheduler/src/lib.rs b/index-scheduler/src/lib.rs index f461b274b..ef5ca9c49 100644 --- a/index-scheduler/src/lib.rs +++ b/index-scheduler/src/lib.rs @@ -206,28 +206,28 @@ pub enum Breakpoint { #[derive(Debug)] pub struct IndexSchedulerOptions { /// The path to the version file of Meilisearch. - version_file_path: PathBuf, + pub version_file_path: PathBuf, /// The path to the folder containing the auth LMDB env. - auth_path: PathBuf, + pub auth_path: PathBuf, /// The path to the folder containing the task databases. - tasks_path: PathBuf, + pub tasks_path: PathBuf, /// The path to the file store containing the files associated to the tasks. - update_file_path: PathBuf, + pub update_file_path: PathBuf, /// The path to the folder containing meilisearch's indexes. - indexes_path: PathBuf, + pub indexes_path: PathBuf, /// The path to the folder containing the snapshots. - snapshots_path: PathBuf, + pub snapshots_path: PathBuf, /// The path to the folder containing the dumps. - dumps_path: PathBuf, + pub dumps_path: PathBuf, /// The maximum size, in bytes, of each meilisearch index. - task_db_size: usize, + pub task_db_size: usize, /// The maximum size, in bytes, of the tasks index. - index_size: usize, + pub index_size: usize, /// Configuration used during indexing for each meilisearch index. - indexer_config: IndexerConfig, + pub indexer_config: IndexerConfig, /// Set to `true` iff the index scheduler is allowed to automatically /// batch tasks together, to process multiple tasks at once. - autobatching_enabled: bool, + pub autobatching_enabled: bool, } /// Structure which holds meilisearch's indexes and schedules the tasks diff --git a/meilisearch-http/src/lib.rs b/meilisearch-http/src/lib.rs index 825d59704..9a3ce857e 100644 --- a/meilisearch-http/src/lib.rs +++ b/meilisearch-http/src/lib.rs @@ -32,7 +32,7 @@ use anyhow::bail; use error::PayloadError; use extractors::payload::PayloadConfig; use http::header::CONTENT_TYPE; -use index_scheduler::IndexScheduler; +use index_scheduler::{IndexScheduler, IndexSchedulerOptions}; use log::error; use meilisearch_auth::AuthController; use meilisearch_types::milli::documents::{DocumentsBatchBuilder, DocumentsBatchReader}; @@ -114,19 +114,19 @@ pub fn setup_meilisearch(opt: &Opt) -> anyhow::Result<(Arc, Auth // wrap our two builders in a closure that'll be executed later. let auth_controller_builder = || AuthController::new(&opt.db_path, &opt.master_key); let index_scheduler_builder = || { - IndexScheduler::new( - opt.db_path.join(VERSION_FILE_NAME), - opt.db_path.join("auth"), - opt.db_path.join("tasks"), - opt.db_path.join("update_files"), - opt.db_path.join("indexes"), - opt.snapshot_dir.clone(), - opt.dumps_dir.clone(), - opt.max_task_db_size.get_bytes() as usize, - opt.max_index_size.get_bytes() as usize, - (&opt.indexer_options).try_into()?, - true, - ) + IndexScheduler::new(IndexSchedulerOptions { + version_file_path: opt.db_path.join(VERSION_FILE_NAME), + auth_path: opt.db_path.join("auth"), + tasks_path: opt.db_path.join("tasks"), + update_file_path: opt.db_path.join("update_files"), + indexes_path: opt.db_path.join("indexes"), + snapshots_path: opt.snapshot_dir.clone(), + dumps_path: opt.dumps_dir.clone(), + task_db_size: opt.max_task_db_size.get_bytes() as usize, + index_size: opt.max_index_size.get_bytes() as usize, + indexer_config: (&opt.indexer_options).try_into()?, + autobatching_enabled: !opt.scheduler_options.disable_auto_batching, + }) }; let meilisearch_builder = || -> anyhow::Result<_> { // if anything wrong happens we delete the `data.ms` entirely.