diff options
author | Chris <ccbrown112@gmail.com> | 2017-09-12 09:19:52 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-12 09:19:52 -0500 |
commit | b066b6df138e88e75cb40f1ec3e58fbd13e61909 (patch) | |
tree | 7ee0e8c935cd3bbafd15d0d07d8900af8b82a4e0 /cmd/platform/import.go | |
parent | 674a606bd00b276d0a05b3b29a3d5f5e5e7f8206 (diff) | |
download | chat-b066b6df138e88e75cb40f1ec3e58fbd13e61909.tar.gz chat-b066b6df138e88e75cb40f1ec3e58fbd13e61909.tar.bz2 chat-b066b6df138e88e75cb40f1ec3e58fbd13e61909.zip |
Remove global app references (#7433)
* remove global app references
* test fix
* fix api4 test compilation
Diffstat (limited to 'cmd/platform/import.go')
-rw-r--r-- | cmd/platform/import.go | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/cmd/platform/import.go b/cmd/platform/import.go index 30e07cebf..85cb3835b 100644 --- a/cmd/platform/import.go +++ b/cmd/platform/import.go @@ -8,7 +8,6 @@ import ( "fmt" - "github.com/mattermost/mattermost-server/app" "github.com/spf13/cobra" ) @@ -45,7 +44,8 @@ func init() { } func slackImportCmdF(cmd *cobra.Command, args []string) error { - if err := initDBCommandContextCobra(cmd); err != nil { + a, err := initDBCommandContextCobra(cmd) + if err != nil { return err } @@ -71,7 +71,7 @@ func slackImportCmdF(cmd *cobra.Command, args []string) error { CommandPrettyPrintln("Running Slack Import. This may take a long time for large teams or teams with many messages.") - app.Global().SlackImport(fileReader, fileInfo.Size(), team.Id) + a.SlackImport(fileReader, fileInfo.Size(), team.Id) CommandPrettyPrintln("Finished Slack Import.") @@ -79,7 +79,8 @@ func slackImportCmdF(cmd *cobra.Command, args []string) error { } func bulkImportCmdF(cmd *cobra.Command, args []string) error { - if err := initDBCommandContextCobra(cmd); err != nil { + a, err := initDBCommandContextCobra(cmd) + if err != nil { return err } @@ -121,7 +122,7 @@ func bulkImportCmdF(cmd *cobra.Command, args []string) error { CommandPrettyPrintln("") - if err, lineNumber := app.Global().BulkImport(fileReader, !apply, workers); err != nil { + if err, lineNumber := a.BulkImport(fileReader, !apply, workers); err != nil { CommandPrettyPrintln(err.Error()) if lineNumber != 0 { CommandPrettyPrintln(fmt.Sprintf("Error occurred on data file line %v", lineNumber)) |