update Session

This commit is contained in:
wh_zcy 2023-03-17 14:28:09 +08:00
parent 97ea52b9e4
commit cf5d2991d7

View File

@ -155,6 +155,7 @@ func (this *User) ResetSession() {
for _, v := range us {
this.modelSession.DelListlds(comm.RDS_EMPTY, []string{v.Uid})
}
this.modelSession.Del(comm.RDS_EMPTY)
}
// 清除session
@ -162,7 +163,6 @@ func (this *User) CleanSession(session comm.IUserSession) {
this.stopTicker(session.GetUserId())
if !this.IsCross() {
this.modelUser.updateOfflineTime(session.GetUserId())
}
// sId := fmt.Sprintf("%s-%s", comm.RDS_EMPTY, session.GetUserId())
// this.modelSession.Del(sId, db.SetDBMgoLog(false))
@ -170,6 +170,7 @@ func (this *User) CleanSession(session comm.IUserSession) {
//确保删除的会话是目标会话 不是就不要删除了
if user := this.modelSession.getUserSession(session.GetUserId()); user != nil && user.SessionId == session.GetSessionId() {
this.modelSession.Del(session.GetUserId(), db.SetDBMgoLog(false))
this.modelSession.DelListlds(comm.RDS_EMPTY, []string{session.GetUserId()}, db.SetDBMgoLog(false))
}
this.modelUser.DelByUId(session.GetUserId(), db.SetDBMgoLog(false))
this.modelExpand.DelByUId(session.GetUserId(), db.SetDBMgoLog(false))