summaryrefslogtreecommitdiffstats
path: root/cmd/platform/server.go
diff options
context:
space:
mode:
authorGeorge Goldberg <george@gberg.me>2018-02-06 17:25:53 +0000
committerGeorge Goldberg <george@gberg.me>2018-02-06 17:25:53 +0000
commit7941c30117efe1b957ac0458c2f0479e3824196d (patch)
treedf791632a9dc790a6f73dec53aae3ba919ebda63 /cmd/platform/server.go
parente1cd64613591cf5a990442a69ebf188258bd0cb5 (diff)
parent034dbc07e3068c482e654b6a1a8fcbe4b01c44f3 (diff)
downloadchat-7941c30117efe1b957ac0458c2f0479e3824196d.tar.gz
chat-7941c30117efe1b957ac0458c2f0479e3824196d.tar.bz2
chat-7941c30117efe1b957ac0458c2f0479e3824196d.zip
Merge branch 'master' into advanced-permissions-phase-1
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 cfcefbba8..e55ad70d0 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()
@@ -174,6 +174,8 @@ func runServer(configFileLocation string, disableConfigWatch bool) {
a.Jobs.StopSchedulers()
a.Jobs.StopWorkers()
+
+ return nil
}
func runSecurityJob(a *app.App) {