Skip to content

Commit

Permalink
Prevent exception when connectionPoolParams overwrite the defaults
Browse files Browse the repository at this point in the history
Previous code threw an exception if the connectionPoolParams were
overwritten in a manner that removed the `randomizeHosts` option.
  • Loading branch information
polyfractal committed Feb 27, 2014
1 parent bb389c0 commit f164e10
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Elasticsearch/ConnectionPool/AbstractConnectionPool.php
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@ public function __construct($connections, SelectorInterface $selector, Connectio
}
}

$randomizeHosts = $connectionPoolParams['randomizeHosts'];
if (isset($randomizeHosts) === true && $randomizeHosts === true) {
if (isset($connectionPoolParams['randomizeHosts']) === true
&& $connectionPoolParams['randomizeHosts'] === true) {
shuffle($connections);
}

Expand Down

0 comments on commit f164e10

Please sign in to comment.