Skip to content

Commit

Permalink
Fix errcheck issues in server/channels/jobs/batch_report_worker.go (m…
Browse files Browse the repository at this point in the history
…attermost#28864)

Co-authored-by: Ben Schumacher <[email protected]>
  • Loading branch information
azadDsync and hanzei authored Oct 29, 2024
1 parent 71bf777 commit 7803c10
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
1 change: 0 additions & 1 deletion server/.golangci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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|\
Expand Down
9 changes: 7 additions & 2 deletions server/channels/jobs/batch_report_worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Expand Down Expand Up @@ -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 {
Expand Down

0 comments on commit 7803c10

Please sign in to comment.