From 14e36a22d69ab9e10b5335d8169cffab3d9de789 Mon Sep 17 00:00:00 2001 From: Ferran Vidal Date: Thu, 10 Dec 2020 16:38:46 +0100 Subject: [PATCH] [Cache] Make use of `read_timeout` in `\RedisSentinel` and `\Redis` Both classes have an optional argument `$readTimeout` that can be set during initialization for `\RedisSentinel` and during `connect`/`pconnect` respectively. --- src/Symfony/Component/Cache/Traits/RedisTrait.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/Cache/Traits/RedisTrait.php b/src/Symfony/Component/Cache/Traits/RedisTrait.php index 55750f8feb64d..851ff9832a68f 100644 --- a/src/Symfony/Component/Cache/Traits/RedisTrait.php +++ b/src/Symfony/Component/Cache/Traits/RedisTrait.php @@ -184,7 +184,7 @@ public static function createConnection($dsn, array $options = []) $port = $hosts[0]['port'] ?? null; if (isset($params['redis_sentinel'])) { - $sentinel = new \RedisSentinel($host, $port, $params['timeout'], (string) $params['persistent_id'], $params['retry_interval']); + $sentinel = new \RedisSentinel($host, $port, $params['timeout'], (string) $params['persistent_id'], $params['retry_interval'], $params['read_timeout']); if (![$host, $port] = $sentinel->getMasterAddrByName($params['redis_sentinel'])) { throw new InvalidArgumentException(sprintf('Failed to retrieve master information from master name "%s" and address "%s:%d".', $params['redis_sentinel'], $host, $port)); @@ -192,7 +192,7 @@ public static function createConnection($dsn, array $options = []) } try { - @$redis->{$connect}($host, $port, $params['timeout'], (string) $params['persistent_id'], $params['retry_interval']); + @$redis->{$connect}($host, $port, $params['timeout'], (string) $params['persistent_id'], $params['retry_interval'], $params['read_timeout']); set_error_handler(function ($type, $msg) use (&$error) { $error = $msg; }); $isConnected = $redis->isConnected(); 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