diff options
author | George Goldberg <george@gberg.me> | 2017-07-27 08:48:02 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-27 08:48:02 +0100 |
commit | ff0a7905166e29ecf9404fa90d23af7863885384 (patch) | |
tree | edb8f060e2e083cdb55ed4c0d464ac44b7112242 /app | |
parent | 244b15ea5b7039ecca1614140cbcf62ba3379184 (diff) | |
download | chat-ff0a7905166e29ecf9404fa90d23af7863885384.tar.gz chat-ff0a7905166e29ecf9404fa90d23af7863885384.tar.bz2 chat-ff0a7905166e29ecf9404fa90d23af7863885384.zip |
PLT-7040: Fix capitalisation of Elasticsearch in Config. (#7020)
Diffstat (limited to 'app')
-rw-r--r-- | app/elasticsearch.go | 6 | ||||
-rw-r--r-- | app/post.go | 10 |
2 files changed, 8 insertions, 8 deletions
diff --git a/app/elasticsearch.go b/app/elasticsearch.go index 857ed570a..740042ba5 100644 --- a/app/elasticsearch.go +++ b/app/elasticsearch.go @@ -12,9 +12,9 @@ import ( ) func TestElasticsearch(cfg *model.Config) *model.AppError { - if *cfg.ElasticSearchSettings.Password == model.FAKE_SETTING { - if *cfg.ElasticSearchSettings.ConnectionUrl == *utils.Cfg.ElasticSearchSettings.ConnectionUrl && *cfg.ElasticSearchSettings.Username == *utils.Cfg.ElasticSearchSettings.Username { - *cfg.ElasticSearchSettings.Password = *utils.Cfg.ElasticSearchSettings.Password + if *cfg.ElasticsearchSettings.Password == model.FAKE_SETTING { + if *cfg.ElasticsearchSettings.ConnectionUrl == *utils.Cfg.ElasticsearchSettings.ConnectionUrl && *cfg.ElasticsearchSettings.Username == *utils.Cfg.ElasticsearchSettings.Username { + *cfg.ElasticsearchSettings.Password = *utils.Cfg.ElasticsearchSettings.Password } else { return model.NewAppError("TestElasticsearch", "ent.elasticsearch.test_config.reenter_password", nil, "", http.StatusBadRequest) } diff --git a/app/post.go b/app/post.go index 447fef6bb..99626c41f 100644 --- a/app/post.go +++ b/app/post.go @@ -100,7 +100,7 @@ func CreatePost(post *model.Post, teamId string, triggerWebhooks bool) (*model.P } esInterface := einterfaces.GetElasticsearchInterface() - if esInterface != nil && *utils.Cfg.ElasticSearchSettings.EnableIndexing { + if esInterface != nil && *utils.Cfg.ElasticsearchSettings.EnableIndexing { go esInterface.IndexPost(rpost, teamId) } @@ -285,10 +285,10 @@ func UpdatePost(post *model.Post, safeUpdate bool) (*model.Post, *model.AppError rpost := result.Data.(*model.Post) esInterface := einterfaces.GetElasticsearchInterface() - if esInterface != nil && *utils.Cfg.ElasticSearchSettings.EnableIndexing { + if esInterface != nil && *utils.Cfg.ElasticsearchSettings.EnableIndexing { go func() { if rchannel := <-Srv.Store.Channel().GetForPost(rpost.Id); rchannel.Err != nil { - l4g.Error("Couldn't get channel %v for post %v for ElasticSearch indexing.", rpost.ChannelId, rpost.Id) + l4g.Error("Couldn't get channel %v for post %v for Elasticsearch indexing.", rpost.ChannelId, rpost.Id) } else { esInterface.IndexPost(rpost, rchannel.Data.(*model.Channel).TeamId) } @@ -472,7 +472,7 @@ func DeletePost(postId string) (*model.Post, *model.AppError) { go DeleteFlaggedPosts(post.Id) esInterface := einterfaces.GetElasticsearchInterface() - if esInterface != nil && *utils.Cfg.ElasticSearchSettings.EnableIndexing { + if esInterface != nil && *utils.Cfg.ElasticsearchSettings.EnableIndexing { go esInterface.DeletePost(post) } @@ -503,7 +503,7 @@ func SearchPostsInTeam(terms string, userId string, teamId string, isOrSearch bo paramsList := model.ParseSearchParams(terms) esInterface := einterfaces.GetElasticsearchInterface() - if esInterface != nil && *utils.Cfg.ElasticSearchSettings.EnableSearching && utils.IsLicensed && *utils.License.Features.Elasticsearch { + if esInterface != nil && *utils.Cfg.ElasticsearchSettings.EnableSearching && utils.IsLicensed && *utils.License.Features.Elasticsearch { finalParamsList := []*model.SearchParams{} for _, params := range paramsList { |