Skip to content

Commit

Permalink
-add masterOnly parameter in getCluster fuction (#146)
Browse files Browse the repository at this point in the history
Co-authored-by: Chuang Zhang <chuangzhang@freewheel.tv>
  • Loading branch information
laozhang007 and Chuang Zhang authored Nov 6, 2020
1 parent efdf60d commit c27faa1
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Sentinel.php
Original file line number Diff line number Diff line change
Expand Up @@ -250,13 +250,15 @@ public function createCluster($name, $db=0, $replicas=128, $selectRandomSlave=tr
* @param int $replicas
* @param bool $selectRandomSlave
* @param bool $writeOnly
* @param bool $masterOnly
* @return Credis_Cluster
* @throws CredisException
* @deprecated
*/
public function getCluster($name, $db=0, $replicas=128, $selectRandomSlave=true, $writeOnly=false)
public function getCluster($name, $db=0, $replicas=128, $selectRandomSlave=true, $writeOnly=false, $masterOnly=false)
{
if(!isset($this->_cluster[$name])){
$this->_cluster[$name] = $this->createCluster($name, $db, $replicas, $selectRandomSlave, $writeOnly);
$this->_cluster[$name] = $this->createCluster($name, $db, $replicas, $selectRandomSlave, $writeOnly, $masterOnly);
}
return $this->_cluster[$name];
}
Expand Down

0 comments on commit c27faa1

Please sign in to comment.