summaryrefslogtreecommitdiffstats
path: root/app/elasticsearch.go
diff options
context:
space:
mode:
Diffstat (limited to 'app/elasticsearch.go')
-rw-r--r--app/elasticsearch.go21
1 files changed, 11 insertions, 10 deletions
diff --git a/app/elasticsearch.go b/app/elasticsearch.go
index c3b558bce..2e731f5d7 100644
--- a/app/elasticsearch.go
+++ b/app/elasticsearch.go
@@ -18,27 +18,28 @@ func (a *App) TestElasticsearch(cfg *model.Config) *model.AppError {
}
}
- if esI := a.Elasticsearch; esI != nil {
- if err := esI.TestConfig(cfg); err != nil {
- return err
- }
- } else {
+ esI := a.Elasticsearch
+ if esI == nil {
err := model.NewAppError("TestElasticsearch", "ent.elasticsearch.test_config.license.error", nil, "", http.StatusNotImplemented)
return err
}
+ if err := esI.TestConfig(cfg); err != nil {
+ return err
+ }
return nil
}
func (a *App) PurgeElasticsearchIndexes() *model.AppError {
- if esI := a.Elasticsearch; esI != nil {
- if err := esI.PurgeIndexes(); err != nil {
- return err
- }
- } else {
+ esI := a.Elasticsearch
+ if esI == nil {
err := model.NewAppError("PurgeElasticsearchIndexes", "ent.elasticsearch.test_config.license.error", nil, "", http.StatusNotImplemented)
return err
}
+ if err := esI.PurgeIndexes(); err != nil {
+ return err
+ }
+
return nil
}