diff --git a/src/Connection/Aggregate/SentinelReplication.php b/src/Connection/Aggregate/SentinelReplication.php index d71b505a..baa284df 100644 --- a/src/Connection/Aggregate/SentinelReplication.php +++ b/src/Connection/Aggregate/SentinelReplication.php @@ -639,13 +639,13 @@ class SentinelReplication implements ReplicationInterface try { $response = $this->getConnection($command)->$method($command); } catch (CommunicationException $exception) { + $this->wipeServerList(); + $exception->getConnection()->disconnect(); + if ($retries == $this->retryLimit) { throw $exception; } - $this->wipeServerList(); - $exception->getConnection()->disconnect(); - usleep($this->retryWait * 1000); ++$retries;