mirror of
https://github.com/predis/predis.git
synced 2026-08-24 20:59:37 +00:00
Disconnect before eventually throwing exception.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user