From 20691236cc7951aa45d54640c8e3df2f0b48fbd7 Mon Sep 17 00:00:00 2001 From: Luke Park Date: Fri, 6 May 2022 14:56:09 +0900 Subject: [PATCH] feat: apply compact window && update check logic * apply concept of compact window * update check logic --- metadium/admin.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/metadium/admin.go b/metadium/admin.go index 5803541b4ffb..ace5687c38b6 100644 --- a/metadium/admin.go +++ b/metadium/admin.go @@ -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)) }