Refactor.
This commit is contained in:
parent
50edaff3ce
commit
c5dfa98ffe
@ -32,7 +32,7 @@ import (
|
|||||||
"github.com/ethereum/go-ethereum/statediff/indexer/shared"
|
"github.com/ethereum/go-ethereum/statediff/indexer/shared"
|
||||||
)
|
)
|
||||||
|
|
||||||
const period = 1 * time.Minute
|
const logInterval = 1 * time.Minute
|
||||||
|
|
||||||
// Publisher is wrapper around DB.
|
// Publisher is wrapper around DB.
|
||||||
type Publisher struct {
|
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.
|
// printNodeCounters prints number of node processed.
|
||||||
func (p *Publisher) printNodeCounters() {
|
func (p *Publisher) printNodeCounters() {
|
||||||
t := time.NewTicker(period)
|
t := time.NewTicker(logInterval)
|
||||||
for range t.C {
|
for range t.C {
|
||||||
logrus.Infof("processed state nodes %d", atomic.LoadUint64(&p.stateNodeCounter))
|
logrus.Infof("processed state nodes %d", atomic.LoadUint64(&p.stateNodeCounter))
|
||||||
logrus.Infof("processed storage nodes %d", atomic.LoadUint64(&p.storageNodeCounter))
|
logrus.Infof("processed storage nodes %d", atomic.LoadUint64(&p.storageNodeCounter))
|
||||||
|
Loading…
Reference in New Issue
Block a user