MM-14143 config cleanup final (#10374)
* 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
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
3716918c57
Коммит
1e462da2d4
@@ -85,15 +85,3 @@ func FindDir(dir string) (string, bool) {
|
||||
|
||||
return found, true
|
||||
}
|
||||
|
||||
// FindConfigFile attempts to find an existing configuration file. fileName can be an absolute or
|
||||
// relative path or name such as "/opt/mattermost/config.json" or simply "config.json". An empty
|
||||
// string is returned if no configuration is found.
|
||||
func FindConfigFile(fileName string) (path string) {
|
||||
found := FindFile(filepath.Join("config", fileName))
|
||||
if found == "" {
|
||||
found = FindPath(fileName, []string{"."}, nil)
|
||||
}
|
||||
|
||||
return found
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user