MDL-85336 redis: Support floats in connection timeout

This commit is contained in:
Benjamin Walker
2025-12-08 09:06:27 +10:00
parent fcb3f1de83
commit d018536312
2 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -380,7 +380,7 @@ $CFG->admin = 'admin';
// $CFG->session_redis_lock_expire = 7200; // Optional, defaults to session timeout.
// $CFG->session_redis_lock_retry = 100; // Optional wait between lock attempts in ms, default is 100.
// // After 5 seconds it will throttle down to once per second.
// $CFG->session_redis_connection_timeout = 3; // Optional, default is 3.
// $CFG->session_redis_connection_timeout = 3.0; // Optional, default is 3.0.
// $CFG->session_redis_maxretries = 3; // Optional, default is 3.
//
// Use the igbinary serializer instead of the php default one. Note that phpredis must be compiled with
+3 -3
View File
@@ -114,8 +114,8 @@ class redis extends handler implements SessionHandlerInterface {
/** @var clock A clock instance */
protected clock $clock;
/** @var int $connectiontimeout The number of seconds to wait for a connection or response from the Redis server. */
protected int $connectiontimeout = 3;
/** @var float $connectiontimeout The number of seconds to wait for a connection or response from the Redis server. */
protected float $connectiontimeout = 3.0;
/**
* Create new instance of handler.
@@ -205,7 +205,7 @@ class redis extends handler implements SessionHandlerInterface {
}
if (isset($CFG->session_redis_connection_timeout)) {
$this->connectiontimeout = (int)$CFG->session_redis_connection_timeout;
$this->connectiontimeout = (float)$CFG->session_redis_connection_timeout;
}
if (isset($CFG->session_redis_max_retries)) {