MM-56879: Migrate caches from store layer to cache layer (#26255)
There were 3 remaining caches which were there in the store layer. We migrate them to make the store layer fully free from any caches. https://mattermost.atlassian.net/browse/MM-56879 ```release-note NONE ``` Co-authored-by: Mattermost Build <build@mattermost.com>
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
d7a77d8c42
Коммит
204c728b08
@@ -17,9 +17,6 @@ func (ps *PlatformService) RegisterClusterHandlers() {
|
||||
ps.clusterIFace.RegisterClusterMessageHandler(model.ClusterEventPublish, ps.ClusterPublishHandler)
|
||||
ps.clusterIFace.RegisterClusterMessageHandler(model.ClusterEventUpdateStatus, ps.ClusterUpdateStatusHandler)
|
||||
ps.clusterIFace.RegisterClusterMessageHandler(model.ClusterEventInvalidateAllCaches, ps.ClusterInvalidateAllCachesHandler)
|
||||
ps.clusterIFace.RegisterClusterMessageHandler(model.ClusterEventInvalidateCacheForChannelMembersNotifyProps, ps.clusterInvalidateCacheForChannelMembersNotifyPropHandler)
|
||||
ps.clusterIFace.RegisterClusterMessageHandler(model.ClusterEventInvalidateCacheForChannelByName, ps.clusterInvalidateCacheForChannelByNameHandler)
|
||||
ps.clusterIFace.RegisterClusterMessageHandler(model.ClusterEventInvalidateCacheForUser, ps.clusterInvalidateCacheForUserHandler)
|
||||
ps.clusterIFace.RegisterClusterMessageHandler(model.ClusterEventInvalidateCacheForUserTeams, ps.clusterInvalidateCacheForUserTeamsHandler)
|
||||
ps.clusterIFace.RegisterClusterMessageHandler(model.ClusterEventBusyStateChanged, ps.clusterBusyStateChgHandler)
|
||||
ps.clusterIFace.RegisterClusterMessageHandler(model.ClusterEventClearSessionCacheForUser, ps.clusterClearSessionCacheForUserHandler)
|
||||
@@ -70,18 +67,6 @@ func (ps *PlatformService) ClusterInvalidateAllCachesHandler(msg *model.ClusterM
|
||||
ps.InvalidateAllCachesSkipSend()
|
||||
}
|
||||
|
||||
func (ps *PlatformService) clusterInvalidateCacheForChannelMembersNotifyPropHandler(msg *model.ClusterMessage) {
|
||||
ps.invalidateCacheForChannelMembersNotifyPropsSkipClusterSend(string(msg.Data))
|
||||
}
|
||||
|
||||
func (ps *PlatformService) clusterInvalidateCacheForChannelByNameHandler(msg *model.ClusterMessage) {
|
||||
ps.invalidateCacheForChannelByNameSkipClusterSend(msg.Props["id"], msg.Props["name"])
|
||||
}
|
||||
|
||||
func (ps *PlatformService) clusterInvalidateCacheForUserHandler(msg *model.ClusterMessage) {
|
||||
ps.InvalidateCacheForUserSkipClusterSend(string(msg.Data))
|
||||
}
|
||||
|
||||
func (ps *PlatformService) clusterInvalidateCacheForUserTeamsHandler(msg *model.ClusterMessage) {
|
||||
ps.invalidateWebConnSessionCacheForUser(string(msg.Data))
|
||||
}
|
||||
@@ -118,23 +103,6 @@ func (ps *PlatformService) clusterBusyStateChgHandler(msg *model.ClusterMessage)
|
||||
}
|
||||
}
|
||||
|
||||
func (ps *PlatformService) invalidateCacheForChannelMembersNotifyPropsSkipClusterSend(channelID string) {
|
||||
ps.Store.Channel().InvalidateCacheForChannelMembersNotifyProps(channelID)
|
||||
}
|
||||
|
||||
func (ps *PlatformService) invalidateCacheForChannelByNameSkipClusterSend(teamID, name string) {
|
||||
if teamID == "" {
|
||||
teamID = "dm"
|
||||
}
|
||||
|
||||
ps.Store.Channel().InvalidateChannelByName(teamID, name)
|
||||
}
|
||||
|
||||
func (ps *PlatformService) InvalidateCacheForUserSkipClusterSend(userID string) {
|
||||
ps.Store.Channel().InvalidateAllChannelMembersForUser(userID)
|
||||
ps.invalidateWebConnSessionCacheForUser(userID)
|
||||
}
|
||||
|
||||
func (ps *PlatformService) invalidateWebConnSessionCacheForUser(userID string) {
|
||||
hub := ps.GetHubForUserId(userID)
|
||||
if hub != nil {
|
||||
|
||||
Ссылка в новой задаче
Block a user