#113071 Замена predis для работы с sentinel
This commit is contained in:
		@@ -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);
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user