From 4315f076493ce068e8a124de0ecbef084535f870 Mon Sep 17 00:00:00 2001 From: Sasha Rybkin Date: Wed, 30 Jul 2025 16:09:14 +0300 Subject: [PATCH] =?UTF-8?q?#113071=20=D0=97=D0=B0=D0=BC=D0=B5=D0=BD=D0=B0?= =?UTF-8?q?=20predis=20=D0=B4=D0=BB=D1=8F=20=D1=80=D0=B0=D0=B1=D0=BE=D1=82?= =?UTF-8?q?=D1=8B=20=D1=81=20sentinel?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Connectors/PhpRedisSentinelConnector.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Connectors/PhpRedisSentinelConnector.php b/src/Connectors/PhpRedisSentinelConnector.php index 61d81d4..bf4c709 100644 --- a/src/Connectors/PhpRedisSentinelConnector.php +++ b/src/Connectors/PhpRedisSentinelConnector.php @@ -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);