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 удалений

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

@@ -93,7 +93,7 @@ type Actions struct {
DoUploadFile func(time.Time, string, string, string, string, []byte) (*model.FileInfo, *model.AppError)
GenerateThumbnailImage func(request.CTX, image.Image, string, string)
GeneratePreviewImage func(request.CTX, image.Image, string, string)
InvalidateAllCaches func()
InvalidateAllCaches func() *model.AppError
MaxPostSize func() int
PrepareImage func(fileData []byte) (image.Image, string, func(), error)
}
@@ -210,7 +210,9 @@ func (si *SlackImporter) SlackImport(rctx request.CTX, fileData multipart.File,
si.deactivateSlackBotUser(rctx, botUser)
}
si.actions.InvalidateAllCaches()
if err := si.actions.InvalidateAllCaches(); err != nil {
return err, log
}
log.WriteString(i18n.T("api.slackimport.slack_import.notes"))
log.WriteString("=======\r\n\r\n")