MM-57512: Disable content extraction during import (#26619)
https://mattermost.atlassian.net/browse/MM-57512 ```release-note NONE ```
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
fc8e537288
Коммит
273d4432b4
@@ -156,7 +156,7 @@ func bulkImportCmdF(command *cobra.Command, args []string) error {
|
||||
|
||||
CommandPrettyPrintln("")
|
||||
|
||||
if err, lineNumber := a.BulkImportWithPath(rctx, fileReader, nil, !apply, workers, importPath); err != nil {
|
||||
if err, lineNumber := a.BulkImportWithPath(rctx, fileReader, nil, true, !apply, workers, importPath); err != nil {
|
||||
CommandPrintErrorln(err.Error())
|
||||
if lineNumber != 0 {
|
||||
CommandPrintErrorln(fmt.Sprintf("Error occurred on data file line %v", lineNumber))
|
||||
|
||||
@@ -112,6 +112,7 @@ func init() {
|
||||
ImportValidateCmd.Flags().Bool("check-server-duplicates", true, "Set to false to ignore teams, channels, and users already present on the server")
|
||||
|
||||
ImportProcessCmd.Flags().Bool("bypass-upload", false, "If this is set, the file is not processed from the server, but rather directly read from the filesystem. Works only in --local mode.")
|
||||
ImportProcessCmd.Flags().Bool("extract-content", true, "If this is set, document attachments will be extracted and indexed during the import process. It is advised to disable it to improve performance.")
|
||||
|
||||
ImportListCmd.AddCommand(
|
||||
ImportListAvailableCmd,
|
||||
@@ -271,11 +272,14 @@ func importProcessCmdF(c client.Client, command *cobra.Command, args []string) e
|
||||
}
|
||||
}
|
||||
|
||||
extractContent, _ := command.Flags().GetBool("extract-content")
|
||||
|
||||
job, _, err := c.CreateJob(context.TODO(), &model.Job{
|
||||
Type: model.JobTypeImportProcess,
|
||||
Data: map[string]string{
|
||||
"import_file": importFile,
|
||||
"local_mode": strconv.FormatBool(isLocal && bypassUpload),
|
||||
"import_file": importFile,
|
||||
"local_mode": strconv.FormatBool(isLocal && bypassUpload),
|
||||
"extract_content": strconv.FormatBool(extractContent),
|
||||
},
|
||||
})
|
||||
if err != nil {
|
||||
|
||||
@@ -210,7 +210,11 @@ func (s *MmctlUnitTestSuite) TestImportProcessCmdF() {
|
||||
importFile := "import.zip"
|
||||
mockJob := &model.Job{
|
||||
Type: model.JobTypeImportProcess,
|
||||
Data: map[string]string{"import_file": importFile, "local_mode": "false"},
|
||||
Data: map[string]string{
|
||||
"import_file": importFile,
|
||||
"local_mode": "false",
|
||||
"extract_content": "false",
|
||||
},
|
||||
}
|
||||
|
||||
s.client.
|
||||
|
||||
@@ -27,8 +27,9 @@ Options
|
||||
|
||||
::
|
||||
|
||||
--bypass-upload If this is set, the file is not processed from the server, but rather directly read from the filesystem. Works only in --local mode.
|
||||
-h, --help help for process
|
||||
--bypass-upload If this is set, the file is not processed from the server, but rather directly read from the filesystem. Works only in --local mode.
|
||||
--extract-content If this is set, document attachments will be extracted and indexed during the import process. It is advised to disable it to improve performance. (default true)
|
||||
-h, --help help for process
|
||||
|
||||
Options inherited from parent commands
|
||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
Ссылка в новой задаче
Block a user