Skip to content

Commit

Permalink
fix: create snapshot dir for rocksdb backend (#15054)
Browse files Browse the repository at this point in the history
(cherry picked from commit 497dc2c)
  • Loading branch information
yihuang authored and mergify[bot] committed Feb 17, 2023
1 parent 06406f6 commit 284cc1b
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions server/util.go
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,10 @@ func DefaultBaseappOptions(appOpts types.AppOptions) []func(*baseapp.BaseApp) {
}

snapshotDir := filepath.Join(cast.ToString(appOpts.Get(flags.FlagHome)), "data", "snapshots")
if err = os.MkdirAll(snapshotDir, os.ModePerm); err != nil {
panic(fmt.Errorf("failed to create snapshots directory: %w", err))
}

snapshotDB, err := dbm.NewDB("metadata", GetAppDBBackend(appOpts), snapshotDir)
if err != nil {
panic(err)
Expand Down

0 comments on commit 284cc1b

Please sign in to comment.