private function retryCommandOnFailure(CommandInterface $command, $method)
{
$failure = false;
RETRY_COMMAND:
try {
$response = $this->getConnectionByCommand($command)->{$method}($command);
} catch (ConnectionException $exception) {
$connection = $exception->getConnection();
$connection->disconnect();
$this->remove($connection);
if ($failure) {
throw $exception;
} elseif ($this->useClusterSlots) {
$this->askSlotMap();
}
$failure = true;
goto RETRY_COMMAND;
}
return $response;
}