Fixed duplicated logging errors

This commit is contained in:
StephenButtolph 2020-06-10 02:41:58 -04:00
parent 9e1d24c239
commit 426fac9b10
2 changed files with 10 additions and 11 deletions

View File

@ -147,8 +147,11 @@ func (b *bootstrapper) process(vtx avalanche.Vertex) error {
numDropped: b.numBSDroppedVtx,
vtx: vtx,
}); err == nil {
b.numFetched++ // Progress tracker
b.numBSBlockedVtx.Inc()
b.numFetched++ // Progress tracker
if b.numFetched%common.StatusUpdateFrequency == 0 {
b.BootstrapConfig.Context.Log.Info("fetched %d vertices", b.numFetched)
}
} else {
b.BootstrapConfig.Context.Log.Verbo("couldn't push to vtxBlocked: %s", err)
}
@ -169,10 +172,6 @@ func (b *bootstrapper) process(vtx avalanche.Vertex) error {
}
b.processedCache.Put(vtx.ID(), nil)
}
if b.numFetched%common.StatusUpdateFrequency == 0 {
b.BootstrapConfig.Context.Log.Info("fetched %d vertices", b.numFetched)
}
}
if err := b.VtxBlocked.Commit(); err != nil {

View File

@ -35,8 +35,8 @@ type bootstrapper struct {
// true if all of the vertices in the original accepted frontier have been processed
processedStartingAcceptedFrontier bool
// Number of blocks processed
numProcessed uint32
// Number of blocks fetched
numFetched uint32
// tracks which validators were asked for which containers in which requests
outstandingRequests common.Requests
@ -183,16 +183,16 @@ func (b *bootstrapper) process(blk snowman.Block) error {
status := blk.Status()
blkID := blk.ID()
for status == choices.Processing {
b.numProcessed++ // Progress tracker
if b.numProcessed%common.StatusUpdateFrequency == 0 { // Periodically print progress
b.BootstrapConfig.Context.Log.Info("processed %d blocks", b.numProcessed)
}
if err := b.Blocked.Push(&blockJob{
numAccepted: b.numBootstrapped,
numDropped: b.numDropped,
blk: blk,
}); err == nil {
b.numBlocked.Inc()
b.numFetched++ // Progress tracker
if b.numFetched%common.StatusUpdateFrequency == 0 { // Periodically print progress
b.BootstrapConfig.Context.Log.Info("fetched %d blocks", b.numFetched)
}
}
if err := b.Blocked.Commit(); err != nil {