Explorar el Código

Prevent unnesessary log

Shelikhoo hace 9 años
padre
commit
2bf9edfe7d
Se han modificado 1 ficheros con 3 adiciones y 1 borrados
  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