fixed not expire messages cache after follow user

pull/393/head
Michael Li 1 year ago
parent 4aae50d2a7
commit 9aec4fba38
No known key found for this signature in database

@ -33,6 +33,7 @@ const (
const ( const (
_messageActionCreate uint8 = iota _messageActionCreate uint8 = iota
_messageActionRead _messageActionRead
_messageActionFollow
) )
type cacheUnreadMsgEvent struct { type cacheUnreadMsgEvent struct {
@ -200,7 +201,8 @@ func (e *messageActionEvent) Action() (err error) {
case _messageActionRead: case _messageActionRead:
// 清除未读消息数缓存,不需要处理错误 // 清除未读消息数缓存,不需要处理错误
e.wc.DelUnreadMsgCountResp(userId) e.wc.DelUnreadMsgCountResp(userId)
case _messageActionCreate: case _messageActionCreate,
_messageActionFollow:
fallthrough fallthrough
default: default:
// TODO // TODO

@ -104,6 +104,7 @@ func (s *followshipSrv) FollowUser(r *web.FollowUserReq) mir.Error {
// 触发缓存更新事件 // 触发缓存更新事件
cache.OnCacheMyFollowIdsEvent(s.Ds, r.User.ID) cache.OnCacheMyFollowIdsEvent(s.Ds, r.User.ID)
cache.OnExpireIndexTweetEvent(r.User.ID) cache.OnExpireIndexTweetEvent(r.User.ID)
onMessageActionEvent(_messageActionFollow, r.User.ID)
return nil return nil
} }

Loading…
Cancel
Save