Skip to content

Commit

Permalink
fix: do not apply migration conflict strategy when opening the sled s…
Browse files Browse the repository at this point in the history
…tore more than once (whisperfish#228)
  • Loading branch information
gferon authored Jan 4, 2024
1 parent 0e536d5 commit dac9b35
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions presage-store-sled/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ fn migrate(
Ok(())
};

if let Err(error) = run_migrations() {
if let Err(SledStoreError::MigrationConflict) = run_migrations() {
match migration_conflict_strategy {
MigrationConflictStrategy::BackupAndDrop => {
let mut new_db_path = db_path.to_path_buf();
Expand All @@ -373,7 +373,7 @@ fn migrate(
MigrationConflictStrategy::Drop => {
fs_extra::dir::remove(db_path)?;
}
MigrationConflictStrategy::Raise => return Err(error),
MigrationConflictStrategy::Raise => return Err(SledStoreError::MigrationConflict),
}
}

Expand Down

0 comments on commit dac9b35

Please sign in to comment.