Skip to content

Commit

Permalink
Merge pull request #2782 from 10up/fix/es-server-info
Browse files Browse the repository at this point in the history
Only try to get ES info if a server is set
  • Loading branch information
felipeelia authored May 20, 2022
2 parents cea4516 + 9d65f29 commit 956f421
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions includes/classes/Elasticsearch.php
Original file line number Diff line number Diff line change
Expand Up @@ -1276,8 +1276,7 @@ public function parse_api_response( $response ) {
* @return array
*/
public function get_elasticsearch_info( $force = false ) {

if ( $force || null === $this->elasticsearch_version || null === $this->elasticsearch_plugins ) {
if ( ! empty( Utils\get_host() ) && ( $force || null === $this->elasticsearch_version || null === $this->elasticsearch_plugins ) ) {

// Get ES info from cache if available. If we are forcing, then skip cache check.
if ( $force ) {
Expand Down

0 comments on commit 956f421

Please sign in to comment.