* TestGetLicenseFileFromDisk: avoid using fileutils.FindConfigFile

* config: abstract config-related file access, extend memory store

* simplify config validate to avoid file knowledge

* fix relative file tests

* cluster: fix ConfigChanged event

The old and new configurations were swapped when notifying the enterprise code of configuration changes, creating needless instability in propagating config updates across a cluster.

* config/database: ignore duplicates

* test cleanup

* remove unnecessary Save() in test
Этот коммит содержится в:
Jesse Hallam
2019-03-06 15:06:45 -05:00
коммит произвёл GitHub
родитель 3716918c57
Коммит 1e462da2d4
28 изменённых файлов: 1454 добавлений и 545 удалений

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

@@ -7,11 +7,9 @@ import (
"net"
"net/http"
"net/url"
"os"
"strings"
"github.com/mattermost/mattermost-server/model"
"github.com/mattermost/mattermost-server/utils/fileutils"
)
func StringInSlice(a string, slice []string) bool {
@@ -40,17 +38,6 @@ func StringArrayIntersection(arr1, arr2 []string) []string {
return result
}
func FileExistsInConfigFolder(filename string) bool {
if len(filename) == 0 {
return false
}
if _, err := os.Stat(fileutils.FindConfigFile(filename)); err == nil {
return true
}
return false
}
func RemoveDuplicatesFromStringArray(arr []string) []string {
result := make([]string, 0, len(arr))
seen := make(map[string]bool)