mirror of
https://github.com/predis/predis.git
synced 2026-09-10 18:37:34 +00:00
Fix bug during assertion of connection role.
ROLE was not being sent to master when still disconnected and with an empty slaves pool preventing the client from checking the actual role of the server upon connect().
This commit is contained in:
@@ -535,7 +535,7 @@ class SentinelReplication implements ReplicationInterface
|
||||
{
|
||||
$connection = $this->getConnectionInternal($command);
|
||||
|
||||
if (!$connection->isConnected() && $this->slaves) {
|
||||
if (!$connection->isConnected() && ($this->slaves || $this->master)) {
|
||||
$this->assertConnectionRole(
|
||||
$connection,
|
||||
$this->strategy->isReadOperation($command) ? 'slave' : 'master'
|
||||
|
||||
Reference in New Issue
Block a user