Skip to content

Commit 7c98ee1

Browse files
bug #39431 [Cache] Make use of read_timeout in \RedisSentinel and \Redis (ferrastas)
This PR was merged into the 5.3-dev branch. Discussion ---------- [Cache] Make use of `read_timeout` in `\RedisSentinel` and `\Redis` | Q | A | ------------- | --- | Branch? | 5.x | Bug fix? | yes | New feature? | no | Deprecations? | no | Tickets | Fix #39429 | License | MIT This is a bugfix for #39363 a feature introduced in 5.x As described in issue #39429, `\RedisSentinel` accepts an optional read timeout value during construction. `read_timeout` is already part of the connection options, this PR just make use of it. Commits ------- 14e36a2 [Cache] Make use of `read_timeout` in `\RedisSentinel` and `\Redis`
2 parents 19b20ab + 14e36a2 commit 7c98ee1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,15 +184,15 @@ public static function createConnection($dsn, array $options = [])
184184
$port = $hosts[0]['port'] ?? null;
185185

186186
if (isset($params['redis_sentinel'])) {
187-
$sentinel = new \RedisSentinel($host, $port, $params['timeout'], (string) $params['persistent_id'], $params['retry_interval']);
187+
$sentinel = new \RedisSentinel($host, $port, $params['timeout'], (string) $params['persistent_id'], $params['retry_interval'], $params['read_timeout']);
188188

189189
if (![$host, $port] = $sentinel->getMasterAddrByName($params['redis_sentinel'])) {
190190
throw new InvalidArgumentException(sprintf('Failed to retrieve master information from master name "%s" and address "%s:%d".', $params['redis_sentinel'], $host, $port));
191191
}
192192
}
193193

194194
try {
195-
@$redis->{$connect}($host, $port, $params['timeout'], (string) $params['persistent_id'], $params['retry_interval']);
195+
@$redis->{$connect}($host, $port, $params['timeout'], (string) $params['persistent_id'], $params['retry_interval'], $params['read_timeout']);
196196

197197
set_error_handler(function ($type, $msg) use (&$error) { $error = $msg; });
198198
$isConnected = $redis->isConnected();

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy