From 78251a3ff1986f389c98a1e1af7943f53913a418 Mon Sep 17 00:00:00 2001 From: Tim Scheuermann Date: Fri, 9 Sep 2022 16:20:56 +0200 Subject: [PATCH] Initialize the logger for imports (#20978) --- jobs/import_process/worker.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/jobs/import_process/worker.go b/jobs/import_process/worker.go index be09177006..5747d04b93 100644 --- a/jobs/import_process/worker.go +++ b/jobs/import_process/worker.go @@ -17,6 +17,7 @@ import ( "github.com/mattermost/mattermost-server/v6/model" "github.com/mattermost/mattermost-server/v6/services/configservice" "github.com/mattermost/mattermost-server/v6/shared/filestore" + "github.com/mattermost/mattermost-server/v6/shared/mlog" ) const jobName = "ImportProcess" @@ -28,10 +29,11 @@ type AppIface interface { FileSize(path string) (int64, *model.AppError) FileReader(path string) (filestore.ReadCloseSeeker, *model.AppError) BulkImportWithPath(c *request.Context, jsonlReader io.Reader, attachmentsReader *zip.Reader, dryRun bool, workers int, importPath string) (*model.AppError, int) + Log() *mlog.Logger } func MakeWorker(jobServer *jobs.JobServer, app AppIface) model.Worker { - appContext := request.EmptyContext(nil) + appContext := request.EmptyContext(app.Log()) isEnabled := func(cfg *model.Config) bool { return true }