Add optional config parameter to test elasticsearch endpoint. (#6877)
Этот коммит содержится в:
коммит произвёл
Joram Wilander
родитель
db2f6cf076
Коммит
39b071bc0e
@@ -19,12 +19,17 @@ func InitElasticsearch() {
|
||||
}
|
||||
|
||||
func testElasticsearch(c *Context, w http.ResponseWriter, r *http.Request) {
|
||||
cfg := model.ConfigFromJson(r.Body)
|
||||
if cfg == nil {
|
||||
cfg = utils.Cfg
|
||||
}
|
||||
|
||||
if !app.SessionHasPermissionTo(c.Session, model.PERMISSION_MANAGE_SYSTEM) {
|
||||
c.SetPermissionError(model.PERMISSION_MANAGE_SYSTEM)
|
||||
return
|
||||
}
|
||||
|
||||
if err := app.TestElasticsearch(); err != nil {
|
||||
if err := app.TestElasticsearch(cfg); err != nil {
|
||||
c.Err = err
|
||||
return
|
||||
}
|
||||
|
||||
Ссылка в новой задаче
Block a user