MM-56925: Fix unnecessary cache invalidation of pinned post count (#26264)
invalidateCacheForChannelPosts invalidated the pinned post count and the lastPostTime cache. But not all endpoints actually pins or unpins the post. That's only possible via the UpdatePost or PatchPost methods. Therefore, we remove the unnecessary cache invalidation. This is also important because this gets called for every single channel load, and every new post would invalidate this cache. https://mattermost.atlassian.net/browse/MM-56925 ```release-note NONE ```
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
1ae96cefad
Коммит
401de9b321
@@ -46,11 +46,9 @@ func (a *App) SaveAcknowledgementForPost(c request.CTX, postID, userID string) (
|
||||
}
|
||||
|
||||
// The post is always modified since the UpdateAt always changes
|
||||
a.invalidateCacheForChannelPosts(channel.Id)
|
||||
a.Srv().Store().Post().InvalidateLastPostTimeCache(channel.Id)
|
||||
|
||||
a.Srv().Go(func() {
|
||||
a.sendAcknowledgementEvent(model.WebsocketEventAcknowledgementAdded, acknowledgement, post)
|
||||
})
|
||||
a.sendAcknowledgementEvent(model.WebsocketEventAcknowledgementAdded, acknowledgement, post)
|
||||
|
||||
return acknowledgement, nil
|
||||
}
|
||||
@@ -92,11 +90,9 @@ func (a *App) DeleteAcknowledgementForPost(c request.CTX, postID, userID string)
|
||||
}
|
||||
|
||||
// The post is always modified since the UpdateAt always changes
|
||||
a.invalidateCacheForChannelPosts(channel.Id)
|
||||
a.Srv().Store().Post().InvalidateLastPostTimeCache(channel.Id)
|
||||
|
||||
a.Srv().Go(func() {
|
||||
a.sendAcknowledgementEvent(model.WebsocketEventAcknowledgementRemoved, oldAck, post)
|
||||
})
|
||||
a.sendAcknowledgementEvent(model.WebsocketEventAcknowledgementRemoved, oldAck, post)
|
||||
|
||||
return nil
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user