mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-27 03:58:55 +08:00
Merge branch 'v2.3.0release' of github.com:OpenIMSDK/Open-IM-Server into v2.3.0release
This commit is contained in:
commit
e494d21a57
@ -221,7 +221,7 @@ func (ws *WServer) MultiTerminalLoginCheckerWithLock(uid string, platformID int,
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
err = oldConn.Close()
|
err = oldConn.Close()
|
||||||
delete(oldConnMap, platformID)
|
//delete(oldConnMap, platformID)
|
||||||
ws.wsUserToConn[uid] = oldConnMap
|
ws.wsUserToConn[uid] = oldConnMap
|
||||||
if len(oldConnMap) == 0 {
|
if len(oldConnMap) == 0 {
|
||||||
delete(ws.wsUserToConn, uid)
|
delete(ws.wsUserToConn, uid)
|
||||||
@ -363,7 +363,7 @@ func (ws *WServer) delUserConn(conn *UserConn) {
|
|||||||
operationID := utils.OperationIDGenerator()
|
operationID := utils.OperationIDGenerator()
|
||||||
var uid string
|
var uid string
|
||||||
var platform int
|
var platform int
|
||||||
if oldStringMap, ok := ws.wsConnToUser[conn]; ok {
|
if oldStringMap, okg := ws.wsConnToUser[conn]; okg {
|
||||||
for k, v := range oldStringMap {
|
for k, v := range oldStringMap {
|
||||||
platform = k
|
platform = k
|
||||||
uid = v
|
uid = v
|
||||||
@ -383,17 +383,17 @@ func (ws *WServer) delUserConn(conn *UserConn) {
|
|||||||
log.Debug(operationID, "WS delete operation", "", "wsUser deleted", ws.wsUserToConn, "disconnection_uid", uid, "disconnection_platform", platform, "online_user_num", len(ws.wsUserToConn))
|
log.Debug(operationID, "WS delete operation", "", "wsUser deleted", ws.wsUserToConn, "disconnection_uid", uid, "disconnection_platform", platform, "online_user_num", len(ws.wsUserToConn))
|
||||||
}
|
}
|
||||||
delete(ws.wsConnToUser, conn)
|
delete(ws.wsConnToUser, conn)
|
||||||
|
|
||||||
}
|
}
|
||||||
err := conn.Close()
|
err := conn.Close()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Error(operationID, " close err", "", "uid", uid, "platform", platform)
|
log.Error(operationID, " close err", "", "uid", uid, "platform", platform)
|
||||||
}
|
}
|
||||||
callbackResp := callbackUserOffline(operationID, uid, platform)
|
callbackResp := callbackUserOffline(operationID, conn.userID, platform)
|
||||||
if callbackResp.ErrCode != 0 {
|
if callbackResp.ErrCode != 0 {
|
||||||
log.NewError(operationID, utils.GetSelfFuncName(), "callbackUserOffline failed", callbackResp)
|
log.NewError(operationID, utils.GetSelfFuncName(), "callbackUserOffline failed", callbackResp)
|
||||||
}
|
}
|
||||||
promePkg.PromeGaugeDec(promePkg.OnlineUserGauge)
|
promePkg.PromeGaugeDec(promePkg.OnlineUserGauge)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (ws *WServer) getUserConn(uid string, platform int) *UserConn {
|
func (ws *WServer) getUserConn(uid string, platform int) *UserConn {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user