Skip to content

Commit

Permalink
Improve ES health checking
Browse files Browse the repository at this point in the history
Signed-off-by: Raul Sevilla <[email protected]>
  • Loading branch information
rsevilla87 committed Sep 22, 2020
1 parent 1a5123f commit e41f971
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/indexers/elastic.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ func (esIndexer *Elastic) new(esConfig config.IndexerConfig) {
if err != nil {
log.Errorf("Error creating the ES client: %s", err)
}
r, err := ESClient.Ping()
r, err := ESClient.Cluster.Health()
if err != nil {
log.Fatalf("ES connection error: %s", err)
log.Fatalf("ES health check failed: %s", err)
}
if r.StatusCode != 200 {
log.Fatalf("Unexpected ES status code: %d", r.StatusCode)
Expand Down

0 comments on commit e41f971

Please sign in to comment.