From 9232d3ac68a8d23a7f67ec66d8e227c362431507 Mon Sep 17 00:00:00 2001 From: Chris Lu Date: Fri, 14 Feb 2020 10:28:02 -0800 Subject: [PATCH] ignore error when counting closed connections --- weed/util/net_timeout.go | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/weed/util/net_timeout.go b/weed/util/net_timeout.go index b8068e67f..8acd50d42 100644 --- a/weed/util/net_timeout.go +++ b/weed/util/net_timeout.go @@ -66,11 +66,8 @@ func (c *Conn) Write(b []byte) (count int, e error) { } func (c *Conn) Close() error { - err := c.Conn.Close() - if err == nil { - stats.ConnectionClose() - } - return err + stats.ConnectionClose() + return c.Conn.Close() } func NewListener(addr string, timeout time.Duration) (net.Listener, error) {