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

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

Loading…
Cancel
Save