Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 1190150

Browse filesBrowse files
committed
[Cache] fix using multiple Redis Sentinel hosts when the first one is not resolvable
1 parent fcb754a commit 1190150
Copy full SHA for 1190150

File tree

1 file changed

+5
-2
lines changed
Filter options

1 file changed

+5
-2
lines changed

‎src/Symfony/Component/Cache/Traits/RedisTrait.php

Copy file name to clipboardExpand all lines: src/Symfony/Component/Cache/Traits/RedisTrait.php
+5-2Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,8 +217,11 @@ public static function createConnection(string $dsn, array $options = [])
217217
}
218218
$sentinel = new \RedisSentinel($host, $port, $params['timeout'], (string) $params['persistent_id'], $params['retry_interval'], $params['read_timeout'], ...$extra);
219219

220-
if ($address = $sentinel->getMasterAddrByName($params['redis_sentinel'])) {
221-
[$host, $port] = $address;
220+
try {
221+
if ($address = $sentinel->getMasterAddrByName($params['redis_sentinel'])) {
222+
[$host, $port] = $address;
223+
}
224+
} catch (\RedisException $e) {
222225
}
223226
} while (++$hostIndex < \count($hosts) && !$address);
224227

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.