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

This commit is contained in:
zakir-code 2023-07-28 16:04:22 +08:00 committed by GitHub
parent c3daf03e61
commit 54ed7dab39
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

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

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.