|
|
@ -51,6 +51,7 @@ type cacheMyFriendIdsEvent struct {
|
|
|
|
ac core.AppCache
|
|
|
|
ac core.AppCache
|
|
|
|
urs core.UserRelationService
|
|
|
|
urs core.UserRelationService
|
|
|
|
userIds []int64
|
|
|
|
userIds []int64
|
|
|
|
|
|
|
|
expire int64
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
type cacheMyFollowIdsEvent struct {
|
|
|
|
type cacheMyFollowIdsEvent struct {
|
|
|
@ -59,6 +60,7 @@ type cacheMyFollowIdsEvent struct {
|
|
|
|
urs core.UserRelationService
|
|
|
|
urs core.UserRelationService
|
|
|
|
userId int64
|
|
|
|
userId int64
|
|
|
|
key string
|
|
|
|
key string
|
|
|
|
|
|
|
|
expire int64
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func OnExpireIndexTweetEvent(userId int64) {
|
|
|
|
func OnExpireIndexTweetEvent(userId int64) {
|
|
|
@ -106,6 +108,7 @@ func OnCacheMyFriendIdsEvent(urs core.UserRelationService, userIds ...int64) {
|
|
|
|
userIds: userIds,
|
|
|
|
userIds: userIds,
|
|
|
|
urs: urs,
|
|
|
|
urs: urs,
|
|
|
|
ac: _appCache,
|
|
|
|
ac: _appCache,
|
|
|
|
|
|
|
|
expire: conf.CacheSetting.UserRelationExpire,
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -121,6 +124,7 @@ func OnCacheMyFollowIdsEvent(urs core.UserRelationService, userId int64, key ...
|
|
|
|
urs: urs,
|
|
|
|
urs: urs,
|
|
|
|
key: cacheKey,
|
|
|
|
key: cacheKey,
|
|
|
|
ac: _appCache,
|
|
|
|
ac: _appCache,
|
|
|
|
|
|
|
|
expire: conf.CacheSetting.UserRelationExpire,
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -188,7 +192,7 @@ func (e *cacheMyFriendIdsEvent) Action() error {
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
e.ac.Set(conf.KeyMyFriendIds.Get(userId), data, 0)
|
|
|
|
e.ac.Set(conf.KeyMyFriendIds.Get(userId), data, e.expire)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return nil
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -211,6 +215,6 @@ func (e *cacheMyFollowIdsEvent) Action() (err error) {
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
return err
|
|
|
|
return err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
e.ac.Set(e.key, data, 0)
|
|
|
|
e.ac.Set(e.key, data, e.expire)
|
|
|
|
return nil
|
|
|
|
return nil
|
|
|
|
}
|
|
|
|
}
|
|
|
|