diff --git a/library/Rediska/PubSub/Channel.php b/library/Rediska/PubSub/Channel.php index c9f597d..ce26999 100644 --- a/library/Rediska/PubSub/Channel.php +++ b/library/Rediska/PubSub/Channel.php @@ -459,7 +459,9 @@ protected function _execCommand($command, $channels) foreach($channels as $channel) { $execCommand[] = $this->getRediska()->getOption('namespace') . $channel; } - $connection = $this->_connections->getConnectionByAlias($connectionAlias); + if (!$connection){ + $connection = $this->_connections->getConnectionByAlias($connectionAlias); + } $exec = new Rediska_Connection_Exec($connection, $execCommand); $exec->write(); } @@ -467,7 +469,9 @@ protected function _execCommand($command, $channels) // Get responses from connections while (!empty($channelsByConnections)) { foreach ($channelsByConnections as $connectionAlias => $channels) { - $connection = $this->_connections->getConnectionByAlias($connectionAlias); + if (!$connection){ + $connection = $this->_connections->getConnectionByAlias($connectionAlias); + } foreach($channels as $channel) { $response = $this->_getResponseFromConnection($connection);