MM-48181: Invalidate cache to reflect permissions changes from a team scheme. (#21735)

* MM-48181: Bust the allChannelMembersForUserCache when assigning a team scheme.

* MM-48181: Tests cache fix.
Этот коммит содержится в:
Martin Kraft
2022-11-28 11:18:17 -05:00
коммит произвёл GitHub
родитель 98a14c8c55
Коммит 3e7a8d8426
8 изменённых файлов: 85 добавлений и 0 удалений

Просмотреть файл

@@ -669,6 +669,21 @@ func (s *TimerLayerChannelStore) ClearCaches() {
}
}
func (s *TimerLayerChannelStore) ClearMembersForUserCache() {
start := time.Now()
s.ChannelStore.ClearMembersForUserCache()
elapsed := float64(time.Since(start)) / float64(time.Second)
if s.Root.Metrics != nil {
success := "false"
if true {
success = "true"
}
s.Root.Metrics.ObserveStoreMethodDuration("ChannelStore.ClearMembersForUserCache", success, elapsed)
}
}
func (s *TimerLayerChannelStore) ClearSidebarOnTeamLeave(userID string, teamID string) error {
start := time.Now()