fix: handle error from InvalidateAllCaches in slack.go (#30606)

* fix: hanlde error from InvalidateAllCaches in slack.go

* change signature of InvalidateAllCaches to *model.AppError

* return  err from InvalidateAllCaches everywhere

* Formatting

---------

Co-authored-by: Ben Schumacher <ben.schumacher@mattermost.com>
Этот коммит содержится в:
kasyap dharanikota
2025-04-14 13:54:21 +05:30
коммит произвёл GitHub
родитель d808bc94e9
Коммит ae046fb34e
5 изменённых файлов: 15 добавлений и 9 удалений

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

@@ -52,7 +52,9 @@ func (ps *PlatformService) ClusterUpdateStatusHandler(msg *model.ClusterMessage)
}
func (ps *PlatformService) ClusterInvalidateAllCachesHandler(msg *model.ClusterMessage) {
ps.InvalidateAllCachesSkipSend()
if err := ps.InvalidateAllCachesSkipSend(); err != nil {
ps.logger.Error("Error validating caches from cluster message", mlog.Err(err))
}
}
func (ps *PlatformService) clusterInvalidateWebConnSessionCacheForUserHandler(msg *model.ClusterMessage) {
@@ -98,7 +100,7 @@ func (ps *PlatformService) invalidateWebConnSessionCacheForUserSkipClusterSend(u
}
}
func (ps *PlatformService) InvalidateAllCachesSkipSend() {
func (ps *PlatformService) InvalidateAllCachesSkipSend() *model.AppError {
ps.logger.Info("Purging all caches")
ps.ClearAllUsersSessionCacheLocal()
if err := ps.statusCache.Purge(); err != nil {
@@ -115,10 +117,13 @@ func (ps *PlatformService) InvalidateAllCachesSkipSend() {
ps.logger.Warn("Failed to clear the link cache", mlog.Err(err))
}
ps.LoadLicense()
return nil
}
func (ps *PlatformService) InvalidateAllCaches() *model.AppError {
ps.InvalidateAllCachesSkipSend()
if err := ps.InvalidateAllCachesSkipSend(); err != nil {
return err
}
if ps.clusterIFace != nil {
msg := &model.ClusterMessage{