This commit is contained in:
苏尹岚
2020-12-31 10:25:17 +08:00
parent 6d66d1ec35
commit 1a954ad675

View File

@@ -173,10 +173,9 @@ func ImMessage(userID string, ws *websocket.Conn) (err error) {
}
func GetOnlineUserCount() (count int) {
s := new(sync.RWMutex)
s.Lock()
wsClient.s.RLock()
count = len(wsClient.ClientsHeart)
s.Unlock()
wsClient.s.RUnlock()
return count
}