perf: start the goroutine after need to create a snapshot (#17158)

This commit is contained in:
zakir-code
2023-07-28 08:04:22 +00:00
committed by GitHub
parent c3daf03e61
commit 54ed7dab39
2 changed files with 7 additions and 1 deletions
+5
View File
@@ -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
+2 -1
View File
@@ -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.