mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-08 04:18:52 +00:00
Merge pull request #6662 from rxu/ticket/17358
[ticket/17358] Properly handle Redis cache expiration time - 3.3.x
This commit is contained in:
commit
56c1b9b5bd
1 changed files with 5 additions and 5 deletions
10
phpBB/phpbb/cache/driver/redis.php
vendored
10
phpBB/phpbb/cache/driver/redis.php
vendored
|
@ -129,6 +129,10 @@ class redis extends \phpbb\cache\driver\memory
|
||||||
/**
|
/**
|
||||||
* Store data in the cache
|
* Store data in the cache
|
||||||
*
|
*
|
||||||
|
* For the info, see https://phpredis.github.io/phpredis/Redis.html#method_set,
|
||||||
|
* https://redis.io/docs/latest/commands/set/
|
||||||
|
* and https://redis.io/docs/latest/commands/expire/#appendix-redis-expires
|
||||||
|
*
|
||||||
* @access protected
|
* @access protected
|
||||||
* @param string $var Cache key
|
* @param string $var Cache key
|
||||||
* @param mixed $data Data to store
|
* @param mixed $data Data to store
|
||||||
|
@ -137,11 +141,7 @@ class redis extends \phpbb\cache\driver\memory
|
||||||
*/
|
*/
|
||||||
function _write($var, $data, $ttl = 2592000)
|
function _write($var, $data, $ttl = 2592000)
|
||||||
{
|
{
|
||||||
if ($ttl == 0)
|
return $this->redis->set($var, $data, ['EXAT' => time() + $ttl]);
|
||||||
{
|
|
||||||
return $this->redis->set($var, $data);
|
|
||||||
}
|
|
||||||
return $this->redis->setex($var, $ttl, $data);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Add table
Reference in a new issue