Do not wipe server list when removing connection.

This commit is contained in:
Daniele Alessandri
2016-05-19 12:47:24 +02:00
parent 97dfba1e98
commit 6b5181b030
@@ -206,17 +206,18 @@ class SentinelReplication implements ReplicationInterface
*/
public function remove(NodeConnectionInterface $connection)
{
if ($connection->getParameters()->alias === 'master') {
$this->wipeServerList();
if ($connection === $this->master) {
$this->master = null;
$this->reset();
return true;
} else {
if (($id = array_search($connection, $this->slaves, true)) !== false) {
unset($this->slaves[$id]);
$this->wipeServerList();
}
return true;
}
if (false !== $id = array_search($connection, $this->slaves, true)) {
unset($this->slaves[$id]);
$this->reset();
return true;
}
return false;