Fix errcheck issues in server/channels/app/platform/log.go (#29349)

Co-authored-by: Ben Schumacher <ben.schumacher@mattermost.com>
Этот коммит содержится в:
AulakhHarsh
2024-11-26 20:52:31 +05:30
коммит произвёл GitHub
родитель 924bef8b4d
Коммит edbcb247c6
2 изменённых файлов: 8 добавлений и 5 удалений

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

@@ -100,7 +100,6 @@ issues:
channels/app/permissions_test.go|\
channels/app/platform/helper_test.go|\
channels/app/platform/license.go|\
channels/app/platform/log.go|\
channels/app/platform/searchengine.go|\
channels/app/platform/service.go|\
channels/app/platform/service_test.go|\

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

@@ -112,13 +112,17 @@ func (ps *PlatformService) RemoveUnlicensedLogTargets(license *model.License) {
timeoutCtx, cancelCtx := context.WithTimeout(context.Background(), time.Second*10)
defer cancelCtx()
ps.logger.RemoveTargets(timeoutCtx, func(ti mlog.TargetInfo) bool {
if err := ps.logger.RemoveTargets(timeoutCtx, func(ti mlog.TargetInfo) bool {
return ti.Type != "*targets.Writer" && ti.Type != "*targets.File"
})
}); err != nil {
mlog.Error("Failed to remove log targets", mlog.Err(err))
}
ps.notificationsLogger.RemoveTargets(timeoutCtx, func(ti mlog.TargetInfo) bool {
if err := ps.notificationsLogger.RemoveTargets(timeoutCtx, func(ti mlog.TargetInfo) bool {
return ti.Type != "*targets.Writer" && ti.Type != "*targets.File"
})
}); err != nil {
mlog.Error("Failed to remove notification log targets", mlog.Err(err))
}
}
func (ps *PlatformService) GetLogsSkipSend(rctx request.CTX, page, perPage int, logFilter *model.LogFilter) ([]string, *model.AppError) {