mirror of
https://github.com/meilisearch/MeiliSearch
synced 2024-11-30 00:34:26 +01:00
Bug(FS): Consider empty pre-created directory as unexisting DB
This commit is contained in:
parent
1b5ca88231
commit
1ba49d2ddb
@ -167,8 +167,12 @@ impl IndexControllerBuilder {
|
|||||||
|
|
||||||
let db_exists = db_path.as_ref().exists();
|
let db_exists = db_path.as_ref().exists();
|
||||||
if db_exists {
|
if db_exists {
|
||||||
|
// Directory could be pre-created without any database in.
|
||||||
|
let db_is_empty = db_path.as_ref().read_dir()?.next().is_none();
|
||||||
|
if !db_is_empty {
|
||||||
versioning::check_version_file(db_path.as_ref())?;
|
versioning::check_version_file(db_path.as_ref())?;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if let Some(ref path) = self.import_snapshot {
|
if let Some(ref path) = self.import_snapshot {
|
||||||
log::info!("Loading from snapshot {:?}", path);
|
log::info!("Loading from snapshot {:?}", path);
|
||||||
|
Loading…
Reference in New Issue
Block a user