Skip to content

Commit

Permalink
feat: apply compact window && update check logic
Browse files Browse the repository at this point in the history
* apply concept of compact window
* update check logic
  • Loading branch information
lukepark327 authored and MetadiumRelease committed May 6, 2022
1 parent 53ca60d commit 2069123
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions metadium/admin.go
Original file line number Diff line number Diff line change
Expand Up @@ -1095,9 +1095,9 @@ func LogBlock(height int64, hash common.Hash) {
log.Info("Metadium - logged the latest block",
"height", height, "hash", hash, "took", time.Since(tstart))

if (rev%etcdCompactFrequency == 0) && (rev > etcdCompactWindow) {
if ((rev%etcdCompactFrequency == 0) && (rev > etcdCompactFrequency)) && (rev > etcdCompactWindow) {
go func() {
if err := admin.etcdCompact(rev); err != nil {
if err := admin.etcdCompact(rev - etcdCompactWindow + 1); err != nil {
log.Error("Metadium - failed to compact",
"rev", rev, "took", time.Since(tstart))
}
Expand Down

0 comments on commit 2069123

Please sign in to comment.