You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The set method signature on RedisMock seems to be wrong and store ttl in second.
However set should support milliseconds for ttl definition.
Proposal
public function set($key, $value, $options = null, $ttl = null)
{
/**
* Per https://redis.io/commands/set#options
* EX seconds -- Set the specified expire time, in seconds.
* PX milliseconds -- Set the specified expire time, in milliseconds.
* NX -- Only set the key if it does not already exist.
* XX -- Only set the key if it already exist.
*/
if (!is_null($options) && !in_array($options, ['ex', 'px', 'nx', 'xx'])) {
$this->returnPipedInfo('(error) ERR syntax error');
}
if ('nx'=== $options && $this->get($key)) {
return $this->returnPipedInfo(0);
}
if ('xx' === $options && !$this->get($key)) {
return $this->returnPipedInfo(0);
}
if ($options === 'ex') {
$ttl = $ttl;
} elseif ($options === 'px') {
$ttl = $ttl / 1000;
}
self::$dataValues[$this->storage][$key] = $value;
self::$dataTypes[$this->storage][$key] = 'string';
if (!is_null($ttl)) {
self::$dataTtl[$this->storage][$key] = microtime(true) + $ttl;
}
As it will be impacted, We should update RedisSessionHandler, and check that ttl resolution is compatible with symfony session resolution
The text was updated successfully, but these errors were encountered:
The
set
method signature on RedisMock seems to be wrong and store ttl in second.However
set
should support milliseconds for ttl definition.Proposal
As it will be impacted, We should update RedisSessionHandler, and check that ttl resolution is compatible with symfony session resolution
The text was updated successfully, but these errors were encountered: