From 5d844fc3ea3b1a80c07b61565ece406452dfd96a Mon Sep 17 00:00:00 2001 From: Alex Grintsvayg Date: Thu, 30 Aug 2018 21:10:39 -0400 Subject: [PATCH] fix shouldLog --- reflector/stats.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/reflector/stats.go b/reflector/stats.go index 45946fc..5501bbe 100644 --- a/reflector/stats.go +++ b/reflector/stats.go @@ -60,7 +60,7 @@ func (s *stats) AddStream() { s.streams++ } -func (s *stats) AddError(e error) (shouldLog bool) { // shouldLog is a hack, but whataever +func (s *stats) AddError(e error) (shouldLog bool) { // shouldLog is a hack, but whatever if e == nil { return } @@ -70,9 +70,10 @@ func (s *stats) AddError(e error) (shouldLog bool) { // shouldLog is a hack, but name = "i/o timeout" } else if strings.Contains(err.Error(), "read: connection reset by peer") { name = "read conn reset" + } else { + shouldLog = true } - shouldLog = true s.mu.Lock() defer s.mu.Unlock() s.errors[name]++