private function retryCommandOnFailure(CommandInterface $command, $method)
{
$retries = 0;
SENTINEL_RETRY:
try {
$response = $this->getConnection($command)->{$method}($command);
} catch (CommunicationException $exception) {
$this->wipeServerList();
$exception->getConnection()->disconnect();
if ($retries == $this->retryLimit) {
throw $exception;
}
usleep($this->retryWait * 1000);
++$retries;
goto SENTINEL_RETRY;
}
return $response;
}