From d8b4fa7d29de99d147ba878c50c84dc57f97f51f Mon Sep 17 00:00:00 2001 From: taoshihan1991 <630892807@qq.com> Date: Tue, 9 Feb 2021 10:28:52 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E5=AE=A2=E6=9C=8D=E5=9C=A8?= =?UTF-8?q?=E7=BA=BF=E7=8A=B6=E6=80=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- ws/ws.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ws/ws.go b/ws/ws.go index 105121d..c5a616a 100644 --- a/ws/ws.go +++ b/ws/ws.go @@ -101,6 +101,7 @@ func UpdateVisitorStatusCron() { models.UpdateVisitorStatus(visitor.VisitorId, 0) } } + SendPingToKefuClient() time.Sleep(60 * time.Second) } } @@ -137,12 +138,12 @@ func WsServerBackend() { //json.Unmarshal([]byte(typeMsg.Data.(string)),&data) //log.Println(data) //from:=typeMsg.Data["from"] - to:=typeMsg.Data.(map[string]interface{})["to"].(string) + to := typeMsg.Data.(map[string]interface{})["to"].(string) //content:=typeMsg.Data["content"] log.Println(to) Mux.Lock() //conn.WriteMessage(websocket.TextMessage, str) - OneKefuMessage(to,message.content) + OneKefuMessage(to, message.content) Mux.Unlock() }