浏览代码

Prevent unnesessary log

Shelikhoo 9 年之前
父节点
当前提交
2bf9edfe7d
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      transport/internet/ws/wsconn.go

+ 3 - 1
transport/internet/ws/wsconn.go

@@ -195,7 +195,9 @@ func (ws *wsconn) pingPong() {
 			case <-pongRcv:
 				break
 			case <-tick.C:
-				log.Debug("WS:Closing as ping is not responded~" + ws.wsc.UnderlyingConn().LocalAddr().String() + "-" + ws.wsc.UnderlyingConn().RemoteAddr().String())
+				if !ws.connClosing {
+					log.Debug("WS:Closing as ping is not responded~" + ws.wsc.UnderlyingConn().LocalAddr().String() + "-" + ws.wsc.UnderlyingConn().RemoteAddr().String())
+				}
 				ws.Close()
 			}
 			<-tick.C