This commit is contained in:
苏尹岚
2020-12-15 15:01:49 +08:00
parent ab078d7fd9
commit 682e8d2947

View File

@@ -165,6 +165,7 @@ func handleMessages() {
msg := <-broadcast
if msg.GroupID == 0 {
globals.SugarLogger.Debugf("heart %v", utils.Format4Output(msg, false))
if clientsHeart[msg.UserID] != nil {
if err := clientsHeart[msg.UserID].WriteJSON(&model.ImMessageRecord{
Key: "pang",
}); err != nil {
@@ -172,6 +173,7 @@ func handleMessages() {
clientsHeart[msg.UserID].Close() //关闭
delete(clientsHeart, msg.UserID)
}
}
} else {
globals.SugarLogger.Debugf("clients len %v", len(clients))
//循环map客户端