diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/import.go | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/app/import.go b/app/import.go index 078198dd4..496c6b7fc 100644 --- a/app/import.go +++ b/app/import.go @@ -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 +} |