Fix errcheck issues in server/channels/app/platform/log.go (#29349)
Co-authored-by: Ben Schumacher <ben.schumacher@mattermost.com>
Этот коммит содержится в:
@@ -100,7 +100,6 @@ issues:
|
|||||||
channels/app/permissions_test.go|\
|
channels/app/permissions_test.go|\
|
||||||
channels/app/platform/helper_test.go|\
|
channels/app/platform/helper_test.go|\
|
||||||
channels/app/platform/license.go|\
|
channels/app/platform/license.go|\
|
||||||
channels/app/platform/log.go|\
|
|
||||||
channels/app/platform/searchengine.go|\
|
channels/app/platform/searchengine.go|\
|
||||||
channels/app/platform/service.go|\
|
channels/app/platform/service.go|\
|
||||||
channels/app/platform/service_test.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)
|
timeoutCtx, cancelCtx := context.WithTimeout(context.Background(), time.Second*10)
|
||||||
defer cancelCtx()
|
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"
|
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"
|
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) {
|
func (ps *PlatformService) GetLogsSkipSend(rctx request.CTX, page, perPage int, logFilter *model.LogFilter) ([]string, *model.AppError) {
|
||||||
|
|||||||
Ссылка в новой задаче
Block a user