diff --git a/modules/user/module.go b/modules/user/module.go index 136ad8e75..7dd653b1b 100644 --- a/modules/user/module.go +++ b/modules/user/module.go @@ -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))