mirror of
https://github.com/openimsdk/open-im-server.git
synced 2025-04-27 20:30:40 +08:00
offline
This commit is contained in:
parent
07842b0fa7
commit
b235c71c76
@ -221,7 +221,7 @@ func (ws *WServer) MultiTerminalLoginCheckerWithLock(uid string, platformID int,
|
||||
return
|
||||
}
|
||||
err = oldConn.Close()
|
||||
delete(oldConnMap, platformID)
|
||||
//delete(oldConnMap, platformID)
|
||||
ws.wsUserToConn[uid] = oldConnMap
|
||||
if len(oldConnMap) == 0 {
|
||||
delete(ws.wsUserToConn, uid)
|
||||
@ -363,7 +363,6 @@ func (ws *WServer) delUserConn(conn *UserConn) {
|
||||
operationID := utils.OperationIDGenerator()
|
||||
var uid string
|
||||
var platform int
|
||||
var okg bool
|
||||
if oldStringMap, okg := ws.wsConnToUser[conn]; okg {
|
||||
for k, v := range oldStringMap {
|
||||
platform = k
|
||||
@ -384,19 +383,16 @@ 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))
|
||||
}
|
||||
delete(ws.wsConnToUser, conn)
|
||||
|
||||
}
|
||||
err := conn.Close()
|
||||
if err != nil {
|
||||
log.Error(operationID, " close err", "", "uid", uid, "platform", platform)
|
||||
}
|
||||
if okg {
|
||||
callbackResp := callbackUserOffline(operationID, uid, platform)
|
||||
if callbackResp.ErrCode != 0 {
|
||||
log.NewError(operationID, utils.GetSelfFuncName(), "callbackUserOffline failed", callbackResp)
|
||||
}
|
||||
promePkg.PromeGaugeDec(promePkg.OnlineUserGauge)
|
||||
callbackResp := callbackUserOffline(operationID, conn.userID, platform)
|
||||
if callbackResp.ErrCode != 0 {
|
||||
log.NewError(operationID, utils.GetSelfFuncName(), "callbackUserOffline failed", callbackResp)
|
||||
}
|
||||
promePkg.PromeGaugeDec(promePkg.OnlineUserGauge)
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user