Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
mmsqe committed Jul 12, 2023
1 parent 58e6a5e commit 9765f8b
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions memiavl/db.go
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ func Load(dir string, opts Options) (*DB, error) {
snapshotDir := snapshotName(db.lastCommitInfo.Version)
tmpDir := snapshotDir + "-tmp"
path = filepath.Join(db.dir, tmpDir)
if err := os.Remove(path); err != nil {
if err := os.RemoveAll(path); err != nil {
db.logger.Error("failed to remove tmp directories", "err", err)
}

Expand Down Expand Up @@ -471,7 +471,7 @@ func (db *DB) RewriteSnapshot() error {
return err
}
if err := db.MultiTree.WriteSnapshot(path); err != nil {
if err := os.Remove(path); err != nil {
if err := os.RemoveAll(path); err != nil {
db.logger.Error("failed to remove tmp directories", "err", err)
}
return err
Expand Down

0 comments on commit 9765f8b

Please sign in to comment.