Skip to content

Commit

Permalink
add etcdCompactWindow
Browse files Browse the repository at this point in the history
  • Loading branch information
lukepark327 authored and MetadiumRelease committed May 6, 2022
1 parent c440fbe commit 53ca60d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion metadium/admin.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,7 @@ var (
ErrInvalidEnode = errors.New("invalid enode")

etcdCompactFrequency = int64(100)
etcdCompactWindow = int64(100)
)

func (n *metaNode) eq(m *metaNode) bool {
Expand Down Expand Up @@ -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",
Expand Down

0 comments on commit 53ca60d

Please sign in to comment.