mirror of
https://github.com/LBRYFoundation/reflector.go.git
synced 2025-08-23 17:27:25 +00:00
fix shouldLog
This commit is contained in:
parent
4ed52e20d7
commit
5d844fc3ea
1 changed files with 3 additions and 2 deletions
|
@ -60,7 +60,7 @@ func (s *stats) AddStream() {
|
||||||
s.streams++
|
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 {
|
if e == nil {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -70,9 +70,10 @@ func (s *stats) AddError(e error) (shouldLog bool) { // shouldLog is a hack, but
|
||||||
name = "i/o timeout"
|
name = "i/o timeout"
|
||||||
} else if strings.Contains(err.Error(), "read: connection reset by peer") {
|
} else if strings.Contains(err.Error(), "read: connection reset by peer") {
|
||||||
name = "read conn reset"
|
name = "read conn reset"
|
||||||
|
} else {
|
||||||
|
shouldLog = true
|
||||||
}
|
}
|
||||||
|
|
||||||
shouldLog = true
|
|
||||||
s.mu.Lock()
|
s.mu.Lock()
|
||||||
defer s.mu.Unlock()
|
defer s.mu.Unlock()
|
||||||
s.errors[name]++
|
s.errors[name]++
|
||||||
|
|
Loading…
Add table
Reference in a new issue