aa
This commit is contained in:
@@ -173,10 +173,9 @@ func ImMessage(userID string, ws *websocket.Conn) (err error) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func GetOnlineUserCount() (count int) {
|
func GetOnlineUserCount() (count int) {
|
||||||
s := new(sync.RWMutex)
|
wsClient.s.RLock()
|
||||||
s.Lock()
|
|
||||||
count = len(wsClient.ClientsHeart)
|
count = len(wsClient.ClientsHeart)
|
||||||
s.Unlock()
|
wsClient.s.RUnlock()
|
||||||
return count
|
return count
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user