From 27ed5add94bcfe13ae121de0e03ac49381b98e87 Mon Sep 17 00:00:00 2001 From: imdhemy Date: Sat, 24 Feb 2024 20:58:46 +0100 Subject: [PATCH] fix: remove breaking change exception Signed-off-by: imdhemy --- src/OpenSearch/ConnectionPool/SniffingConnectionPool.php | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/OpenSearch/ConnectionPool/SniffingConnectionPool.php b/src/OpenSearch/ConnectionPool/SniffingConnectionPool.php index 04844c4f..296b0e45 100644 --- a/src/OpenSearch/ConnectionPool/SniffingConnectionPool.php +++ b/src/OpenSearch/ConnectionPool/SniffingConnectionPool.php @@ -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; @@ -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; } @@ -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'); - } } }