@@ -76,7 +76,7 @@ type Scheduler struct {
7676 protocols map [string ]int
7777
7878 // A map of errors that happened during the crawl.
79- errors map [string ]int
79+ connErrs map [string ]int
8080
8181 // A map that keeps track of all k-bucket entries of a particular peer.
8282 routingTables map [peer.ID ]* RoutingTable
@@ -116,7 +116,7 @@ func NewScheduler(conf *config.Crawl, dbc db.Client) (*Scheduler, error) {
116116 persistResultsQueue : queue .NewFIFO [* db.InsertVisitResult ](),
117117 agentVersion : map [string ]int {},
118118 protocols : map [string ]int {},
119- errors : map [string ]int {},
119+ connErrs : map [string ]int {},
120120 routingTables : map [peer.ID ]* RoutingTable {},
121121 peerMappings : map [peer.ID ]int {},
122122 }
@@ -402,7 +402,7 @@ func (s *Scheduler) handleResult(ctx context.Context, cr Result) {
402402 }
403403 } else if cr .ConnectError != nil {
404404 // Log and count connection errors
405- s .errors [cr .ConnectErrorStr ] += 1
405+ s .connErrs [cr .ConnectErrorStr ] += 1
406406 if cr .ConnectErrorStr == models .NetErrorUnknown {
407407 logEntry = logEntry .WithError (cr .ConnectError )
408408 } else {
@@ -412,7 +412,6 @@ func (s *Scheduler) handleResult(ctx context.Context, cr Result) {
412412
413413 if cr .ConnectError == nil && cr .CrawlError != nil {
414414 // Log and count crawl errors
415- s .errors [cr .CrawlErrorStr ] += 1
416415 if cr .CrawlErrorStr == models .NetErrorUnknown {
417416 logEntry = logEntry .WithError (cr .CrawlError )
418417 } else {
@@ -453,7 +452,7 @@ func (s *Scheduler) logSummary() {
453452 log .Infoln ("Logging crawl results..." )
454453
455454 log .Infoln ("" )
456- for err , count := range s .errors {
455+ for err , count := range s .connErrs {
457456 log .WithField ("count" , count ).WithField ("value" , err ).Infoln ("Dial Error" )
458457 }
459458 log .Infoln ("" )
@@ -477,7 +476,7 @@ func (s *Scheduler) logSummary() {
477476// TotalErrors counts the total amount of errors - equivalent to undialable peers during this crawl.
478477func (s * Scheduler ) TotalErrors () int {
479478 sum := 0
480- for _ , count := range s .errors {
479+ for _ , count := range s .connErrs {
481480 sum += count
482481 }
483482 return sum
0 commit comments