mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-11-26 23:04:26 +01:00
make clippy happy
This commit is contained in:
parent
8b7735c20a
commit
92a7c8cd17
@ -86,7 +86,7 @@ pub fn import_index(size: usize, uuid: Uuid, dump_path: &Path, db_path: &Path, p
|
|||||||
std::fs::create_dir_all(&index_path)?;
|
std::fs::create_dir_all(&index_path)?;
|
||||||
let mut options = EnvOpenOptions::new();
|
let mut options = EnvOpenOptions::new();
|
||||||
options.map_size(size);
|
options.map_size(size);
|
||||||
let index = milli::Index::new(options.clone(), index_path)?;
|
let index = milli::Index::new(options, index_path)?;
|
||||||
let index = Index(Arc::new(index));
|
let index = Index(Arc::new(index));
|
||||||
|
|
||||||
// extract `settings.json` file and import content
|
// extract `settings.json` file and import content
|
||||||
@ -108,9 +108,6 @@ pub fn import_index(size: usize, uuid: Uuid, dump_path: &Path, db_path: &Path, p
|
|||||||
primary_key,
|
primary_key,
|
||||||
);
|
);
|
||||||
|
|
||||||
// at this point we should handle the updates, but since the update logic is not handled in
|
|
||||||
// meilisearch we are just going to ignore this part
|
|
||||||
|
|
||||||
// the last step: we extract the original milli::Index and close it
|
// the last step: we extract the original milli::Index and close it
|
||||||
Arc::try_unwrap(index.0)
|
Arc::try_unwrap(index.0)
|
||||||
.map_err(|_e| "[dumps] At this point no one is supposed to have a reference on the index")
|
.map_err(|_e| "[dumps] At this point no one is supposed to have a reference on the index")
|
||||||
@ -118,5 +115,8 @@ pub fn import_index(size: usize, uuid: Uuid, dump_path: &Path, db_path: &Path, p
|
|||||||
.prepare_for_closing()
|
.prepare_for_closing()
|
||||||
.wait();
|
.wait();
|
||||||
|
|
||||||
|
// at this point we should handle the import of the updates, but since the update logic is not handled in
|
||||||
|
// meilisearch we are just going to ignore this part
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
@ -73,7 +73,7 @@ fn import_updates(uuid: Uuid, dump_path: &Path, db_path: &Path) -> anyhow::Resul
|
|||||||
for update in reader.lines() {
|
for update in reader.lines() {
|
||||||
let mut update: UpdateStatus = serde_json::from_str(&update?)?;
|
let mut update: UpdateStatus = serde_json::from_str(&update?)?;
|
||||||
if let Some(path) = update.content_path_mut() {
|
if let Some(path) = update.content_path_mut() {
|
||||||
*path = update_path.join("update_files").join(&path).into();
|
*path = update_path.join("update_files").join(&path);
|
||||||
}
|
}
|
||||||
update_store.register_raw_updates(&mut wtxn, update, uuid)?;
|
update_store.register_raw_updates(&mut wtxn, update, uuid)?;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user