summaryrefslogtreecommitdiffstats
path: root/cmd
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
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')
-rw-r--r--cmd/platform/mattermost.go3
-rw-r--r--cmd/platform/sampledata.go8
-rw-r--r--cmd/platform/server.go16
3 files changed, 16 insertions, 11 deletions
diff --git a/cmd/platform/mattermost.go b/cmd/platform/mattermost.go
index 0a6e3f3a6..b0190011b 100644
--- a/cmd/platform/mattermost.go
+++ b/cmd/platform/mattermost.go
@@ -21,6 +21,9 @@ import (
_ "github.com/go-ldap/ldap"
_ "github.com/hashicorp/memberlist"
_ "github.com/mattermost/rsc/qr"
+ _ "github.com/prometheus/client_golang/prometheus"
+ _ "github.com/prometheus/client_golang/prometheus/promhttp"
+ _ "github.com/tylerb/graceful"
_ "gopkg.in/olivere/elastic.v5"
)
diff --git a/cmd/platform/sampledata.go b/cmd/platform/sampledata.go
index 3e8bf1093..98a041d8f 100644
--- a/cmd/platform/sampledata.go
+++ b/cmd/platform/sampledata.go
@@ -346,22 +346,22 @@ func createUser(idx int, teamMemberships int, channelMemberships int, teamsAndCh
}
useMilitaryTime := "false"
- if rand.Intn(2) == 0 {
+ if idx != 0 && rand.Intn(2) == 0 {
useMilitaryTime = "true"
}
collapsePreviews := "false"
- if rand.Intn(2) == 0 {
+ if idx != 0 && rand.Intn(2) == 0 {
collapsePreviews = "true"
}
messageDisplay := "clean"
- if rand.Intn(2) == 0 {
+ if idx != 0 && rand.Intn(2) == 0 {
messageDisplay = "compact"
}
channelDisplayMode := "full"
- if rand.Intn(2) == 0 {
+ if idx != 0 && rand.Intn(2) == 0 {
channelDisplayMode = "centered"
}
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) {