MM-57512: Disable content extraction during import (#26619)
https://mattermost.atlassian.net/browse/MM-57512 ```release-note NONE ```
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
fc8e537288
Коммит
273d4432b4
@@ -29,7 +29,7 @@ type AppIface interface {
|
||||
FileExists(path string) (bool, *model.AppError)
|
||||
FileSize(path string) (int64, *model.AppError)
|
||||
FileReader(path string) (filestore.ReadCloseSeeker, *model.AppError)
|
||||
BulkImportWithPath(c request.CTX, jsonlReader io.Reader, attachmentsReader *zip.Reader, dryRun bool, workers int, importPath string) (*model.AppError, int)
|
||||
BulkImportWithPath(c request.CTX, jsonlReader io.Reader, attachmentsReader *zip.Reader, dryRun, extractContent bool, workers int, importPath string) (*model.AppError, int)
|
||||
Log() *mlog.Logger
|
||||
}
|
||||
|
||||
@@ -123,8 +123,9 @@ func MakeWorker(jobServer *jobs.JobServer, app AppIface) *jobs.SimpleWorker {
|
||||
return model.NewAppError("ImportProcessWorker", "import_process.worker.do_job.missing_jsonl", nil, "jsonFile was nil", http.StatusBadRequest)
|
||||
}
|
||||
|
||||
extractContent := job.Data["extract_content"] == "true"
|
||||
// do the actual import.
|
||||
appErr, lineNumber := app.BulkImportWithPath(appContext, jsonFile, importZipReader, false, runtime.NumCPU(), model.ExportDataDir)
|
||||
appErr, lineNumber := app.BulkImportWithPath(appContext, jsonFile, importZipReader, false, extractContent, runtime.NumCPU(), model.ExportDataDir)
|
||||
if appErr != nil {
|
||||
job.Data["line_number"] = strconv.Itoa(lineNumber)
|
||||
return appErr
|
||||
|
||||
Ссылка в новой задаче
Block a user