diff --git a/server/imserver_new/cache/cachemgr.go b/server/imserver_new/cache/cachemgr.go index 8fd84d3a..6bd44788 100644 --- a/server/imserver_new/cache/cachemgr.go +++ b/server/imserver_new/cache/cachemgr.go @@ -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 diff --git a/server/imserver_new/cache/user_profile.go b/server/imserver_new/cache/user_profile.go index 5fcd8e6c..9250c5fd 100644 --- a/server/imserver_new/cache/user_profile.go +++ b/server/imserver_new/cache/user_profile.go @@ -16,6 +16,7 @@ type userProfile struct { totalWinTimes int32 rank int32 lastLoginTime int32 + lastSyncTime int64 } func (this *userProfile) GetAccountId() string {