MM-11572: Force correct order on messages generated in the bulk (#9244)
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
8bbee74ed8
Коммит
bba3bbd9f3
@@ -100,6 +100,10 @@ func (a *App) BulkImport(fileReader io.Reader, dryRun bool, workers int) (*model
|
||||
return model.NewAppError("BulkImport", "app.import.bulk_import.file_scan.error", nil, err.Error(), http.StatusInternalServerError), 0
|
||||
}
|
||||
|
||||
if err := a.finalizeImport(dryRun); err != nil {
|
||||
return err, 0
|
||||
}
|
||||
|
||||
return nil, 0
|
||||
}
|
||||
|
||||
@@ -165,3 +169,14 @@ func (a *App) ImportLine(line LineImportData, dryRun bool) *model.AppError {
|
||||
return model.NewAppError("BulkImport", "app.import.import_line.unknown_line_type.error", map[string]interface{}{"Type": line.Type}, "", http.StatusBadRequest)
|
||||
}
|
||||
}
|
||||
|
||||
func (a *App) finalizeImport(dryRun bool) *model.AppError {
|
||||
if dryRun {
|
||||
return nil
|
||||
}
|
||||
result := <-a.Srv.Store.Channel().ResetLastPostAt()
|
||||
if result.Err != nil {
|
||||
return result.Err
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user