From 717362d3e9be4031badebe35261dd489689cdaf9 Mon Sep 17 00:00:00 2001 From: Vladimir Mihailenco Date: Mon, 24 Jun 2019 15:27:03 +0300 Subject: [PATCH] Inc StaleConns in ReapStaleConns --- internal/pool/pool.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/pool/pool.go b/internal/pool/pool.go index dacf7be..0a32e03 100644 --- a/internal/pool/pool.go +++ b/internal/pool/pool.go @@ -428,12 +428,11 @@ func (p *ConnPool) reaper(frequency time.Duration) { if p.closed() { break } - n, err := p.ReapStaleConns() + _, err := p.ReapStaleConns() if err != nil { internal.Logger.Printf("ReapStaleConns failed: %s", err) continue } - atomic.AddUint32(&p.stats.StaleConns, uint32(n)) } } @@ -454,6 +453,7 @@ func (p *ConnPool) ReapStaleConns() (int, error) { break } } + atomic.AddUint32(&p.stats.StaleConns, uint32(n)) return n, nil }