mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-12-03 10:52:33 +08:00
fix: Adjust the logic in multiTerminalLoginChecker to prevent onlineUserNum from decreasing below zero, thereby avoiding negative values.
This commit is contained in:
parent
96797976be
commit
677ee2c9b1
@ -345,11 +345,7 @@ func (ws *WsServer) multiTerminalLoginChecker(clientOK bool, oldClients []*Clien
|
|||||||
if !clientOK {
|
if !clientOK {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
ws.clients.deleteClients(newClient.UserID, oldClients)
|
||||||
isDeleteUser := ws.clients.deleteClients(newClient.UserID, oldClients)
|
|
||||||
if isDeleteUser {
|
|
||||||
ws.onlineUserNum.Add(-1)
|
|
||||||
}
|
|
||||||
for _, c := range oldClients {
|
for _, c := range oldClients {
|
||||||
err := c.KickOnlineMessage()
|
err := c.KickOnlineMessage()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user