fix uuid store size

This commit is contained in:
mpostma 2021-09-28 12:05:22 +02:00
parent 539a57026d
commit bcaee4d179
2 changed files with 3 additions and 9 deletions

View File

@ -70,9 +70,8 @@ where U: UuidStore,
Ok(indexes) Ok(indexes)
} }
pub async fn get_size(&self) -> Result<u64> { pub async fn get_uuids_size(&self) -> Result<u64> {
todo!() Ok(self.index_uuid_store.get_size().await?)
//Ok(self.index_store.get_size()? + self.index_uuid_store.get_size().await?)
} }
pub async fn snapshot(&self, path: impl AsRef<Path>) -> Result<Vec<Index>> { pub async fn snapshot(&self, path: impl AsRef<Path>) -> Result<Vec<Index>> {

View File

@ -499,11 +499,6 @@ impl IndexController {
Ok(meta) Ok(meta)
} }
pub async fn get_uuids_size(&self) -> Result<u64> {
let size = self.index_resolver.get_size().await?;
Ok(size)
}
pub async fn get_index_stats(&self, uid: String) -> Result<IndexStats> { pub async fn get_index_stats(&self, uid: String) -> Result<IndexStats> {
let update_infos = UpdateMsg::get_info(&self.update_sender).await?; let update_infos = UpdateMsg::get_info(&self.update_sender).await?;
let index = self.index_resolver.get_index(uid).await?; let index = self.index_resolver.get_index(uid).await?;
@ -516,7 +511,7 @@ impl IndexController {
pub async fn get_all_stats(&self) -> Result<Stats> { pub async fn get_all_stats(&self) -> Result<Stats> {
let update_infos = UpdateMsg::get_info(&self.update_sender).await?; 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<DateTime<_>> = None; let mut last_update: Option<DateTime<_>> = None;
let mut indexes = BTreeMap::new(); let mut indexes = BTreeMap::new();