Reload license from DB for all cluster app servers (#5525)

* Reload license from DB for all cluster app servers

* Increase test timeout
Этот коммит содержится в:
Joram Wilander
2017-02-28 16:39:25 -05:00
коммит произвёл Harrison Healey
родитель 5a3bc43668
Коммит 5e9adddb6f
10 изменённых файлов: 126 добавлений и 106 удалений

Просмотреть файл

@@ -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()
}
}

Просмотреть файл

@@ -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
}

Просмотреть файл

@@ -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 {

Просмотреть файл

@@ -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 {