فهرست منبع

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