Automatic Merge
Этот коммит содержится в:
Maria A Nunez
2026-05-20 01:23:39 -04:00
коммит произвёл GitHub
родитель 07c4273280
Коммит 7c09a18ae9
6 изменённых файлов: 274 добавлений и 8 удалений

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

@@ -66,11 +66,18 @@ func (ps *PlatformService) ClearSessionCacheForUserSkipClusterSend(userID string
ps.invalidateWebConnSessionCacheForUserSkipClusterSend(userID)
}
func (ps *PlatformService) ClearSessionCacheForAllUsersSkipClusterSend() {
// ClearSessionCacheForAllUsersSkipClusterSend purges the in-memory
// session cache and invalidates every WebConn on this node. The hub
// fan-out runs even if the cache purge fails; the purge error is
// returned so wrappers can propagate it.
func (ps *PlatformService) ClearSessionCacheForAllUsersSkipClusterSend() error {
ps.logger.Info("Purging sessions cache")
if err := ps.ClearAllUsersSessionCacheLocal(); err != nil {
err := ps.ClearAllUsersSessionCacheLocal()
if err != nil {
ps.logger.Error("Failed to purge session cache", mlog.Err(err))
}
ps.invalidateWebConnSessionCacheForAllUsersSkipClusterSend()
return err
}
func (ps *PlatformService) clusterClearSessionCacheForUserHandler(msg *model.ClusterMessage) {
@@ -78,7 +85,9 @@ func (ps *PlatformService) clusterClearSessionCacheForUserHandler(msg *model.Clu
}
func (ps *PlatformService) clusterClearSessionCacheForAllUsersHandler(msg *model.ClusterMessage) {
ps.ClearSessionCacheForAllUsersSkipClusterSend()
if err := ps.ClearSessionCacheForAllUsersSkipClusterSend(); err != nil {
ps.logger.Error("Failed to clear session cache for all users from cluster handler", mlog.Err(err))
}
}
func (ps *PlatformService) clusterBusyStateChgHandler(msg *model.ClusterMessage) {
@@ -102,6 +111,17 @@ func (ps *PlatformService) invalidateWebConnSessionCacheForUserSkipClusterSend(u
}
}
// invalidateWebConnSessionCacheForAllUsersSkipClusterSend signals
// every hub on this node to invalidate the cached session state of
// all of its WebConns. Companion to ClearAllUsersSessionCacheLocal.
func (ps *PlatformService) invalidateWebConnSessionCacheForAllUsersSkipClusterSend() {
for _, hub := range ps.hubs {
if hub != nil {
hub.InvalidateAll()
}
}
}
func (ps *PlatformService) InvalidateAllCachesSkipSend() *model.AppError {
ps.logger.Info("Purging all caches")
if err := ps.ClearAllUsersSessionCacheLocal(); err != nil {