mirror of
https://github.com/meilisearch/MeiliSearch
synced 2025-07-04 20:37:15 +02:00
Make the changes necessary to use milli 0.31.1
This commit is contained in:
parent
7feb15df28
commit
dad86fc3d6
11 changed files with 51 additions and 61 deletions
|
@ -3,6 +3,7 @@ use std::fs::{create_dir_all, File};
|
|||
use std::io::{BufRead, BufReader, Write};
|
||||
use std::path::{Path, PathBuf};
|
||||
use std::sync::Arc;
|
||||
use walkdir::WalkDir;
|
||||
|
||||
use milli::heed::types::{SerdeBincode, Str};
|
||||
use milli::heed::{CompactionOption, Database, Env};
|
||||
|
@ -11,7 +12,6 @@ use uuid::Uuid;
|
|||
|
||||
use super::error::{IndexResolverError, Result};
|
||||
use crate::tasks::task::TaskId;
|
||||
use crate::EnvSizer;
|
||||
|
||||
#[derive(Serialize, Deserialize)]
|
||||
pub struct DumpEntry {
|
||||
|
@ -131,7 +131,12 @@ impl HeedMetaStore {
|
|||
}
|
||||
|
||||
fn get_size(&self) -> Result<u64> {
|
||||
Ok(self.env.size())
|
||||
Ok(WalkDir::new(self.env.path())
|
||||
.into_iter()
|
||||
.filter_map(|entry| entry.ok())
|
||||
.filter_map(|entry| entry.metadata().ok())
|
||||
.filter(|metadata| metadata.is_file())
|
||||
.fold(0, |acc, m| acc + m.len()))
|
||||
}
|
||||
|
||||
pub fn dump(&self, path: PathBuf) -> Result<()> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue