Skip to content

Commit

Permalink
fix: create snapshot dir for rocksdb backend (backport #15054) (#15064)
Browse files Browse the repository at this point in the history
Co-authored-by: yihuang <huang@crypto.com>
  • Loading branch information
mergify[bot] and yihuang committed Feb 17, 2023
1 parent 1964f26 commit 96b606f
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 @@ -436,6 +436,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 96b606f

Please sign in to comment.