mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-11-23 05:14:27 +01:00
Merge pull request #305 from meilisearch/fix-example
Make easier to interact with compacted databases
This commit is contained in:
commit
3a1f41ebdb
@ -195,8 +195,9 @@ fn index_command(command: IndexCommand, database: Database) -> Result<(), Box<dy
|
|||||||
);
|
);
|
||||||
|
|
||||||
if let Some(path) = command.compact_to_path {
|
if let Some(path) = command.compact_to_path {
|
||||||
|
fs::create_dir_all(&path)?;
|
||||||
let start = Instant::now();
|
let start = Instant::now();
|
||||||
let _file = database.copy_and_compact_to_path(&path)?;
|
let _file = database.copy_and_compact_to_path(path.join("data.mdb"))?;
|
||||||
println!(
|
println!(
|
||||||
"database compacted in {:.2?} at: {:?}",
|
"database compacted in {:.2?} at: {:?}",
|
||||||
start.elapsed(),
|
start.elapsed(),
|
||||||
|
Loading…
Reference in New Issue
Block a user