summaryrefslogtreecommitdiffstats
path: root/cmd/platform/server.go
diff options
context:
space:
mode:
Diffstat (limited to 'cmd/platform/server.go')
-rw-r--r--cmd/platform/server.go16
1 files changed, 9 insertions, 7 deletions
diff --git a/cmd/platform/server.go b/cmd/platform/server.go
index d289898da..7ac075502 100644
--- a/cmd/platform/server.go
+++ b/cmd/platform/server.go
@@ -28,9 +28,10 @@ const (
var MaxNotificationsPerChannelDefault int64 = 1000000
var serverCmd = &cobra.Command{
- Use: "server",
- Short: "Run the Mattermost server",
- RunE: runServerCmd,
+ Use: "server",
+ Short: "Run the Mattermost server",
+ RunE: runServerCmd,
+ SilenceUsage: true,
}
func runServerCmd(cmd *cobra.Command, args []string) error {
@@ -41,11 +42,10 @@ func runServerCmd(cmd *cobra.Command, args []string) error {
disableConfigWatch, _ := cmd.Flags().GetBool("disableconfigwatch")
- runServer(config, disableConfigWatch)
- return nil
+ return runServer(config, disableConfigWatch)
}
-func runServer(configFileLocation string, disableConfigWatch bool) {
+func runServer(configFileLocation string, disableConfigWatch bool) error {
options := []app.Option{app.ConfigFile(configFileLocation)}
if disableConfigWatch {
options = append(options, app.DisableConfigWatch)
@@ -54,7 +54,7 @@ func runServer(configFileLocation string, disableConfigWatch bool) {
a, err := app.New(options...)
if err != nil {
l4g.Error(err.Error())
- return
+ return err
}
defer a.Shutdown()
@@ -172,6 +172,8 @@ func runServer(configFileLocation string, disableConfigWatch bool) {
a.Jobs.StopSchedulers()
a.Jobs.StopWorkers()
+
+ return nil
}
func runSecurityJob(a *app.App) {