From 5e9adddb6f19a8d18d568871559495ea51b401ae Mon Sep 17 00:00:00 2001 From: Joram Wilander Date: Tue, 28 Feb 2017 16:39:25 -0500 Subject: Reload license from DB for all cluster app servers (#5525) * Reload license from DB for all cluster app servers * Increase test timeout --- cmd/platform/init.go | 3 +-- cmd/platform/license.go | 4 ++-- cmd/platform/oldcommands.go | 4 ++-- cmd/platform/server.go | 2 +- 4 files changed, 6 insertions(+), 7 deletions(-) (limited to 'cmd') diff --git a/cmd/platform/init.go b/cmd/platform/init.go index eb842d302..cbfdb58ce 100644 --- a/cmd/platform/init.go +++ b/cmd/platform/init.go @@ -3,7 +3,6 @@ package main import ( "fmt" - "github.com/mattermost/platform/api" "github.com/mattermost/platform/app" "github.com/mattermost/platform/model" "github.com/mattermost/platform/utils" @@ -41,6 +40,6 @@ func initDBCommandContext(configFileLocation string) { app.NewServer() app.InitStores() if model.BuildEnterpriseReady == "true" { - api.LoadLicense() + app.LoadLicense() } } diff --git a/cmd/platform/license.go b/cmd/platform/license.go index 776f62856..dedc4d306 100644 --- a/cmd/platform/license.go +++ b/cmd/platform/license.go @@ -6,7 +6,7 @@ import ( "errors" "io/ioutil" - "github.com/mattermost/platform/api" + "github.com/mattermost/platform/app" "github.com/spf13/cobra" ) @@ -40,7 +40,7 @@ func uploadLicenseCmdF(cmd *cobra.Command, args []string) error { return err } - if _, err := api.SaveLicense(fileBytes); err != nil { + if _, err := app.SaveLicense(fileBytes); err != nil { return err } diff --git a/cmd/platform/oldcommands.go b/cmd/platform/oldcommands.go index 15ebb25ba..518dcbaaf 100644 --- a/cmd/platform/oldcommands.go +++ b/cmd/platform/oldcommands.go @@ -77,7 +77,7 @@ func doLegacyCommands() { web.InitWeb() if model.BuildEnterpriseReady == "true" { - api.LoadLicense() + app.LoadLicense() } runCmds() @@ -1002,7 +1002,7 @@ func cmdUploadLicense() { flushLogAndExit(1) } - if _, err := api.SaveLicense(fileBytes); err != nil { + if _, err := app.SaveLicense(fileBytes); err != nil { l4g.Error("%v", err) flushLogAndExit(1) } else { diff --git a/cmd/platform/server.go b/cmd/platform/server.go index 00cdb1429..0cb718bcc 100644 --- a/cmd/platform/server.go +++ b/cmd/platform/server.go @@ -74,7 +74,7 @@ func runServer(configFileLocation string) { web.InitWeb() if model.BuildEnterpriseReady == "true" { - api.LoadLicense() + app.LoadLicense() } if !utils.IsLicensed && len(utils.Cfg.SqlSettings.DataSourceReplicas) > 1 { -- cgit v1.2.3-1-g7c22