From 53ca60d48caab9ae5941f37222657ebcb4406af2 Mon Sep 17 00:00:00 2001 From: Luke Park Date: Fri, 6 May 2022 14:44:50 +0900 Subject: [PATCH] add etcdCompactWindow --- metadium/admin.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/metadium/admin.go b/metadium/admin.go index 9c09eaa5f4b9..5803541b4ffb 100644 --- a/metadium/admin.go +++ b/metadium/admin.go @@ -104,6 +104,7 @@ var ( ErrInvalidEnode = errors.New("invalid enode") etcdCompactFrequency = int64(100) + etcdCompactWindow = int64(100) ) func (n *metaNode) eq(m *metaNode) bool { @@ -1094,7 +1095,7 @@ 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 > 100) { + if (rev%etcdCompactFrequency == 0) && (rev > etcdCompactWindow) { go func() { if err := admin.etcdCompact(rev); err != nil { log.Error("Metadium - failed to compact",