1
This commit is contained in:
parent
37a20cdc6d
commit
8aca98863e
8
server/imserver_new/cache/cachemgr.go
vendored
8
server/imserver_new/cache/cachemgr.go
vendored
@ -9,13 +9,20 @@ import (
|
||||
"main/constant"
|
||||
)
|
||||
|
||||
type pendingUser struct {
|
||||
accountId string
|
||||
reqTime int64
|
||||
}
|
||||
|
||||
type cacheMgr struct {
|
||||
lock sync.Mutex
|
||||
userHash map[string]*userProfile
|
||||
pendingHash map[string]*pendingUser
|
||||
}
|
||||
|
||||
func (this *cacheMgr) Init() {
|
||||
this.userHash = make(map[string]*userProfile)
|
||||
this.pendingHash = make(map[string]*pendingUser)
|
||||
}
|
||||
|
||||
func (this *cacheMgr) UnInit() {
|
||||
@ -67,6 +74,7 @@ func (this *cacheMgr) AsyncSearch(sinceId int64, q string,
|
||||
u.avatarUrl = pg.Rows.GetByName("avatar")
|
||||
u.head = pg.Rows.GetByName("head")
|
||||
u.lastLoginTime = q5.ToInt32(pg.Rows.GetByName("last_login_time"))
|
||||
u.lastSyncTime = f5.GetApp().GetNowMillis()
|
||||
this.userHash[u.accountId] = u
|
||||
*q5.NewSliceElement(&users) = u.accountId
|
||||
|
||||
|
1
server/imserver_new/cache/user_profile.go
vendored
1
server/imserver_new/cache/user_profile.go
vendored
@ -16,6 +16,7 @@ type userProfile struct {
|
||||
totalWinTimes int32
|
||||
rank int32
|
||||
lastLoginTime int32
|
||||
lastSyncTime int64
|
||||
}
|
||||
|
||||
func (this *userProfile) GetAccountId() string {
|
||||
|
Loading…
x
Reference in New Issue
Block a user