Skip to content

Commit

Permalink
fix: remove breaking change exception
Browse files Browse the repository at this point in the history
Signed-off-by: imdhemy <[email protected]>
  • Loading branch information
imdhemy committed Feb 25, 2024
1 parent 74c1a80 commit 27ed5ad
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/OpenSearch/ConnectionPool/SniffingConnectionPool.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
namespace OpenSearch\ConnectionPool;

use Exception;
use InvalidArgumentException;
use OpenSearch\Common\Exceptions\NoNodesAvailableException;
use OpenSearch\ConnectionPool\Selectors\SelectorInterface;
use OpenSearch\Connections\Connection;
Expand Down Expand Up @@ -85,7 +84,7 @@ public function scheduleCheck(): void

private function sniff(bool $force = false): void
{
if ($force === false && $this->nextSniff >= time()) {
if ($force === false && $this->nextSniff > time()) {
return;
}

Expand Down Expand Up @@ -171,9 +170,5 @@ private function parseClusterState($nodeInfo): array
private function setConnectionPoolParams(array $connectionPoolParams): void
{
$this->sniffingInterval = (int)($connectionPoolParams['sniffingInterval'] ?? 300);

if ($this->sniffingInterval < 0) {
throw new InvalidArgumentException('sniffingInterval must be greater than or equal to 0');
}
}
}

0 comments on commit 27ed5ad

Please sign in to comment.