[MM-56348] system/ping: add new method with options (#26079)

Этот коммит содержится в:
Ibrahim Serdar Acikgoz
2024-02-20 14:22:28 +01:00
коммит произвёл GitHub
родитель 0aaa047ea3
Коммит 7d8a56019b
9 изменённых файлов: 83 добавлений и 25 удалений

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

@@ -179,6 +179,7 @@ func getSystemPing(c *Context, w http.ResponseWriter, r *http.Request) {
s[filestoreStatusKey] = model.StatusOk
appErr := c.App.TestFileStoreConnection()
if appErr != nil {
c.Logger.Warn("Unable to test filestore connection.", mlog.Err(appErr))
s[filestoreStatusKey] = model.StatusUnhealthy
s[model.STATUS] = model.StatusUnhealthy
}
@@ -194,7 +195,7 @@ func getSystemPing(c *Context, w http.ResponseWriter, r *http.Request) {
s["ActiveSearchBackend"] = c.App.ActiveSearchBackend()
if s[model.STATUS] != model.StatusOk {
if s[model.STATUS] != model.StatusOk && r.FormValue("use_rest_semantics") != "true" {
w.WriteHeader(http.StatusInternalServerError)
}
w.Write([]byte(model.MapToJSON(s)))