From 08ca889f7893bbf73af5d13089de4fce8300bddd Mon Sep 17 00:00:00 2001 From: Akkia Date: Sat, 16 Apr 2022 19:21:20 +0800 Subject: [PATCH] =?UTF-8?q?optimise:=20=E4=BC=98=E5=8C=96websocket?= =?UTF-8?q?=E6=95=B0=E6=8D=AE=E5=8C=85=E5=8F=91=E9=80=81=E9=80=BB=E8=BE=91?= =?UTF-8?q?=20=E5=8A=A0=E5=BF=AB=E9=A6=96=E6=AC=A1=E8=AE=BF=E9=97=AE?= =?UTF-8?q?=E6=97=B6=E7=9B=91=E6=8E=A7=E4=BF=A1=E6=81=AF=E8=BD=BD=E5=85=A5?= =?UTF-8?q?=E9=80=9F=E5=BA=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cmd/dashboard/controller/common_page.go | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/cmd/dashboard/controller/common_page.go b/cmd/dashboard/controller/common_page.go index 42010a5..ca28ffe 100644 --- a/cmd/dashboard/controller/common_page.go +++ b/cmd/dashboard/controller/common_page.go @@ -182,12 +182,7 @@ func (cp *commonPage) ws(c *gin.Context) { if err != nil { continue } - writer, err := conn.NextWriter(websocket.TextMessage) - if err != nil { - break - } - _, err = writer.Write(stat) - if err != nil { + if err := conn.WriteMessage(websocket.TextMessage, stat); err != nil { break } count += 1