#113071 Замена predis для работы с sentinel
This commit is contained in:
parent
0e934d08ac
commit
4315f07649
|
@ -45,7 +45,14 @@ class PhpRedisSentinelConnector extends PhpRedisConnector
|
|||
{
|
||||
$service = $config['sentinel_service'] ?? 'mymaster';
|
||||
|
||||
$sentinel = $this->connectToSentinel($config);
|
||||
$hosts = is_array($config['sentinel_host']) ? $config['sentinel_host'] : [$config['sentinel_host']];
|
||||
foreach ($hosts as $host)
|
||||
{
|
||||
$newConfig = $config;
|
||||
$newConfig['sentinel_host'] = $host;
|
||||
$sentinel = $this->connectToSentinel($newConfig);
|
||||
if($sentinel->ping()) break;
|
||||
}
|
||||
|
||||
$master = $sentinel->master($service);
|
||||
|
||||
|
|
Loading…
Reference in New Issue