diff --git a/meilisearch/src/lib.rs b/meilisearch/src/lib.rs index bee53f6f8..a9bd68934 100644 --- a/meilisearch/src/lib.rs +++ b/meilisearch/src/lib.rs @@ -221,6 +221,7 @@ fn open_or_create_database_unchecked( // we don't want to create anything in the data.ms yet, thus we // wrap our two builders in a closure that'll be executed later. let auth_controller = AuthController::new(&opt.db_path, &opt.master_key); + let instance_features = opt.to_instance_features(); let index_scheduler_builder = || -> anyhow::Result<_> { Ok(IndexScheduler::new(IndexSchedulerOptions { version_file_path: opt.db_path.join(VERSION_FILE_NAME), @@ -238,6 +239,7 @@ fn open_or_create_database_unchecked( max_number_of_tasks: 1_000_000, index_growth_amount: byte_unit::Byte::from_str("10GiB").unwrap().get_bytes() as usize, index_count: DEFAULT_INDEX_COUNT, + instance_features, })?) }; diff --git a/meilisearch/src/option.rs b/meilisearch/src/option.rs index 0511b5033..eaf96ee0c 100644 --- a/meilisearch/src/option.rs +++ b/meilisearch/src/option.rs @@ -12,6 +12,7 @@ use std::{env, fmt, fs}; use byte_unit::{Byte, ByteError}; use clap::Parser; +use meilisearch_types::features::InstanceTogglableFeatures; use meilisearch_types::milli::update::IndexerConfig; use rustls::server::{ AllowAnyAnonymousOrAuthenticatedClient, AllowAnyAuthenticatedClient, ServerSessionMemoryCache, @@ -486,6 +487,10 @@ impl Opt { Ok(None) } } + + pub(crate) fn to_instance_features(&self) -> InstanceTogglableFeatures { + InstanceTogglableFeatures { metrics: self.experimental_enable_metrics } + } } #[derive(Debug, Default, Clone, Parser, Deserialize)]