mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
Remove global cfg vars (#8099)
* remove global cfg vars * enterprise update
This commit is contained in:
@@ -20,7 +20,8 @@ func TestConfigFlag(t *testing.T) {
|
||||
defer os.RemoveAll(dir)
|
||||
|
||||
utils.TranslationsPreInit()
|
||||
config := utils.LoadGlobalConfig("config.json")
|
||||
config, _, err := utils.LoadConfig("config.json")
|
||||
require.Nil(t, err)
|
||||
configPath := filepath.Join(dir, "foo.json")
|
||||
require.NoError(t, ioutil.WriteFile(configPath, []byte(config.ToJson()), 0600))
|
||||
|
||||
|
||||
@@ -4,15 +4,15 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"testing"
|
||||
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path/filepath"
|
||||
"testing"
|
||||
|
||||
"github.com/stretchr/testify/require"
|
||||
|
||||
"github.com/mattermost/mattermost-server/model"
|
||||
"github.com/mattermost/mattermost-server/utils"
|
||||
"github.com/stretchr/testify/require"
|
||||
)
|
||||
|
||||
// There are no tests that actually run the Message Export job, because it can take a long time to complete depending
|
||||
@@ -56,7 +56,8 @@ func writeTempConfig(t *testing.T, isMessageExportEnabled bool) string {
|
||||
require.NoError(t, err)
|
||||
|
||||
utils.TranslationsPreInit()
|
||||
config := utils.LoadGlobalConfig("config.json")
|
||||
config, _, appErr := utils.LoadConfig("config.json")
|
||||
require.Nil(t, appErr)
|
||||
config.MessageExportSettings.EnableExport = model.NewBool(isMessageExportEnabled)
|
||||
configPath := filepath.Join(dir, "foo.json")
|
||||
require.NoError(t, ioutil.WriteFile(configPath, []byte(config.ToJson()), 0600))
|
||||
|
||||
@@ -75,7 +75,7 @@ func runServer(configFileLocation string, disableConfigWatch bool) {
|
||||
}
|
||||
|
||||
a.InitPlugins(*a.Config().PluginSettings.Directory, *a.Config().PluginSettings.ClientDirectory, nil)
|
||||
utils.AddConfigListener(func(prevCfg, cfg *model.Config) {
|
||||
a.AddConfigListener(func(prevCfg, cfg *model.Config) {
|
||||
if *cfg.PluginSettings.Enable {
|
||||
a.InitPlugins(*cfg.PluginSettings.Directory, *a.Config().PluginSettings.ClientDirectory, nil)
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user