diff --git a/store/CHANGELOG.md b/store/CHANGELOG.md index 7b8c1821cc..f308dffc9a 100644 --- a/store/CHANGELOG.md +++ b/store/CHANGELOG.md @@ -25,6 +25,11 @@ Ref: https://keepachangelog.com/en/1.0.0/ ## [Unreleased] +### Improvements + +* [#17158](https://github.com/cosmos/cosmos-sdk/pull/17158) Start the goroutine after need to create a snapshot. + + ## [v1.0.0-alpha.1](https://github.com/cosmos/cosmos-sdk/releases/tag/store%2Fv1.0.0-alpha.1) - 2023-07-11 ### Features diff --git a/store/snapshots/manager.go b/store/snapshots/manager.go index f0c8f85682..78671c2a12 100644 --- a/store/snapshots/manager.go +++ b/store/snapshots/manager.go @@ -514,7 +514,8 @@ func (m *Manager) SnapshotIfApplicable(height int64) { m.logger.Debug("snapshot is skipped", "height", height) return } - m.snapshot(height) + // start the routine after need to create a snapshot + go m.snapshot(height) } // shouldTakeSnapshot returns true is snapshot should be taken at height.