2396: Fix dump bug r=curquiza a=MarinPostma

Only check db version file if we aren't loading a dump or a snapshot, because we can assume that if we are loading a dump or a snapshot, then we can safely work with the database. The db version file will be (over)written just after that.

This was introduced by #2356.
fix #2389


Co-authored-by: ad hoc <postma.marin@protonmail.com>
This commit is contained in:
bors[bot] 2022-05-16 13:59:20 +00:00 committed by GitHub
commit a65a2bea1e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -196,10 +196,7 @@ impl IndexControllerBuilder {
task_store_size, task_store_size,
&indexer_options, &indexer_options,
)?; )?;
} } else if db_path.as_ref().exists() {
let db_exists = db_path.as_ref().exists();
if db_exists {
// Directory could be pre-created without any database in. // Directory could be pre-created without any database in.
let db_is_empty = db_path.as_ref().read_dir()?.next().is_none(); let db_is_empty = db_path.as_ref().read_dir()?.next().is_none();
if !db_is_empty { if !db_is_empty {