MDL-85336 redis: Support floats in connection timeout
This commit is contained in:
+1
-1
@@ -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
|
||||
|
||||
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user