Fix errcheck issues in server/channels/jobs/batch_report_worker.go (#28864)

Co-authored-by: Ben Schumacher <ben.schumacher@mattermost.com>
Этот коммит содержится в:
Domendra Singh Komra
2024-10-29 15:20:54 +05:30
коммит произвёл GitHub
родитель 71bf7777f5
Коммит 7803c10785
2 изменённых файлов: 7 добавлений и 3 удалений

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

@@ -194,7 +194,6 @@ issues:
channels/app/users/users_test.go|\
channels/app/web_broadcast_hooks_test.go|\
channels/app/webhook_test.go|\
channels/jobs/batch_report_worker.go|\
channels/jobs/batch_worker_test.go|\
channels/jobs/helper_test.go|\
channels/jobs/hosted_purchase_screening/worker.go|\

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

@@ -78,7 +78,10 @@ func (worker *BatchReportWorker) doBatch(rctx *request.Context, job *model.Job)
// We might be able to add progress for this type of job in the future
// But for now we can just set to 0
worker.jobServer.SetJobProgress(job, 0)
if err := worker.jobServer.SetJobProgress(job, 0); err != nil {
worker.logger.Error("Worker: Failed to set job progress", mlog.Err(err))
return false
}
return false
}
@@ -124,7 +127,9 @@ func (worker *BatchReportWorker) complete(rctx request.CTX, job *model.Job) erro
}
defer func() {
worker.app.CleanupReportChunks(worker.reportFormat, job.Id, fileCount)
if err := worker.app.CleanupReportChunks(worker.reportFormat, job.Id, fileCount); err != nil {
worker.logger.Error("Worker: Failed to cleanup report chunks", mlog.Err(err))
}
}()
if appErr = worker.app.SendReportToUser(rctx, job, worker.reportFormat); appErr != nil {