MM28858 Basic framework for use of feature flags. Enviroment variable overrides. (#15544)

* Basic framework for use of feature flags. Enviroment variable overrides.

* Use Apperr instead of error number increments.

* Undo random viper change.

* Update model/config_test.go

Co-authored-by: Jesse Hallam <jesse.hallam@gmail.com>

Co-authored-by: Jesse Hallam <jesse.hallam@gmail.com>
Этот коммит содержится в:
Christopher Speller
2020-09-29 21:41:22 -07:00
коммит произвёл GitHub
родитель 61f08d397c
Коммит e974b7b9be
11 изменённых файлов: 130 добавлений и 129 удалений

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

@@ -79,6 +79,11 @@ func getSystemPing(c *Context, w http.ResponseWriter, r *http.Request) {
s["IosLatestVersion"] = reqs.IosLatestVersion
s["IosMinVersion"] = reqs.IosMinVersion
testflag := c.App.Config().FeatureFlags.TestFeature
if testflag != "off" {
s["TestFeatureFlag"] = testflag
}
actualGoroutines := runtime.NumGoroutine()
if *c.App.Config().ServiceSettings.GoroutineHealthThreshold > 0 && actualGoroutines >= *c.App.Config().ServiceSettings.GoroutineHealthThreshold {
mlog.Warn("The number of running goroutines is over the health threshold", mlog.Int("goroutines", actualGoroutines), mlog.Int("health_threshold", *c.App.Config().ServiceSettings.GoroutineHealthThreshold))