From bcaee4d179939126584e077447e00facd1ca4dae Mon Sep 17 00:00:00 2001 From: mpostma Date: Tue, 28 Sep 2021 12:05:22 +0200 Subject: [PATCH] fix uuid store size --- meilisearch-lib/src/index_controller/index_resolver/mod.rs | 5 ++--- meilisearch-lib/src/index_controller/mod.rs | 7 +------ 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/meilisearch-lib/src/index_controller/index_resolver/mod.rs b/meilisearch-lib/src/index_controller/index_resolver/mod.rs index dcd1ed512..eea8e7a2c 100644 --- a/meilisearch-lib/src/index_controller/index_resolver/mod.rs +++ b/meilisearch-lib/src/index_controller/index_resolver/mod.rs @@ -70,9 +70,8 @@ where U: UuidStore, Ok(indexes) } - pub async fn get_size(&self) -> Result { - todo!() - //Ok(self.index_store.get_size()? + self.index_uuid_store.get_size().await?) + pub async fn get_uuids_size(&self) -> Result { + Ok(self.index_uuid_store.get_size().await?) } pub async fn snapshot(&self, path: impl AsRef) -> Result> { diff --git a/meilisearch-lib/src/index_controller/mod.rs b/meilisearch-lib/src/index_controller/mod.rs index 29f5348b1..325082074 100644 --- a/meilisearch-lib/src/index_controller/mod.rs +++ b/meilisearch-lib/src/index_controller/mod.rs @@ -499,11 +499,6 @@ impl IndexController { Ok(meta) } - pub async fn get_uuids_size(&self) -> Result { - let size = self.index_resolver.get_size().await?; - Ok(size) - } - pub async fn get_index_stats(&self, uid: String) -> Result { let update_infos = UpdateMsg::get_info(&self.update_sender).await?; let index = self.index_resolver.get_index(uid).await?; @@ -516,7 +511,7 @@ impl IndexController { pub async fn get_all_stats(&self) -> Result { let update_infos = UpdateMsg::get_info(&self.update_sender).await?; - let mut database_size = self.get_uuids_size().await? + update_infos.size; + let mut database_size = self.index_resolver.get_uuids_size().await? + update_infos.size; let mut last_update: Option> = None; let mut indexes = BTreeMap::new();