From b49808b76648b389c40d570c5403bdb3d5f755c5 Mon Sep 17 00:00:00 2001 From: Roman Khimov Date: Mon, 24 Feb 2020 17:17:25 +0300 Subject: [PATCH] core: reschedule the next persist in a second from previous one It makes little sense queueing up several persistence goroutines (or actually even running them concurrently). --- pkg/core/blockchain.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/core/blockchain.go b/pkg/core/blockchain.go index a75021378..d22326398 100644 --- a/pkg/core/blockchain.go +++ b/pkg/core/blockchain.go @@ -278,8 +278,8 @@ func (bc *Blockchain) Run() { if err != nil { bc.log.Warn("failed to persist blockchain", zap.Error(err)) } + persistTimer.Reset(persistInterval) }() - persistTimer.Reset(persistInterval) } } }