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