Skip to content

Commit

Permalink
Add return to avoid unnecessary computation (opensearch-project#6615)
Browse files Browse the repository at this point in the history
Signed-off-by: Bukhtawar Khan <[email protected]>
  • Loading branch information
Bukhtawar committed Mar 12, 2023
1 parent 671f1ba commit c2388b5
Showing 1 changed file with 1 addition and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,7 @@ private void executeHealth(
if (request.ensureNodeWeighedIn()) {
if (clusterHealthResponse.hasDiscoveredClusterManager() == false) {
listener.onFailure(new ClusterManagerNotDiscoveredException("cluster-manager not discovered"));
return;
} else {
DiscoveryNode localNode = currentState.getNodes().getLocalNode();
// TODO: make this check more generic, check for node role instead
Expand Down

0 comments on commit c2388b5

Please sign in to comment.