From 44299459ffbbbe484740c14a8dbe39c59667f663 Mon Sep 17 00:00:00 2001 From: Erope Date: Sun, 4 Apr 2021 01:01:04 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B2=A1=E5=95=A5=E7=94=A8=E7=9A=84=E5=A4=84?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cmd/dashboard/controller/common_page.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cmd/dashboard/controller/common_page.go b/cmd/dashboard/controller/common_page.go index 5a97624..68a0693 100644 --- a/cmd/dashboard/controller/common_page.go +++ b/cmd/dashboard/controller/common_page.go @@ -195,7 +195,10 @@ func (cp *commonPage) ws(c *gin.Context) { } count += 1 if count%4 == 0 { - conn.WriteMessage(websocket.PingMessage, []byte{}) + err = conn.WriteMessage(websocket.PingMessage, []byte{}) + if err != nil { + break + } } time.Sleep(time.Second * 2) }