Refactor.

This commit is contained in:
Arijit Das 2021-12-23 20:04:34 +05:30
parent 50edaff3ce
commit c5dfa98ffe

View File

@ -32,7 +32,7 @@ import (
"github.com/ethereum/go-ethereum/statediff/indexer/shared"
)
const period = 1 * time.Minute
const logInterval = 1 * time.Minute
// Publisher is wrapper around DB.
type Publisher struct {
@ -189,7 +189,7 @@ func (p *Publisher) checkBatchSize(tx *sqlx.Tx, maxBatchSize uint) (*sqlx.Tx, er
// printNodeCounters prints number of node processed.
func (p *Publisher) printNodeCounters() {
t := time.NewTicker(period)
t := time.NewTicker(logInterval)
for range t.C {
logrus.Infof("processed state nodes %d", atomic.LoadUint64(&p.stateNodeCounter))
logrus.Infof("processed storage nodes %d", atomic.LoadUint64(&p.storageNodeCounter))