mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
[ticket/15320] Redis cache does not save keys withouth expiration
In some functions like sql_save in cache/memory.php, code try to save a key/value in cache with ttl = 0 so key should never expire. In current redis.php cache driver, it fails so key never get cached. This cause for example that when you create a subforum, it not appear in the forum box in the admincp. To solve, if ttl is 0, we use redis->set instead of setex
This commit is contained in:
parent
1e605efaf1
commit
a6c9119dfa
1 changed files with 4 additions and 0 deletions
4
phpBB/phpbb/cache/driver/redis.php
vendored
4
phpBB/phpbb/cache/driver/redis.php
vendored
|
@ -137,6 +137,10 @@ 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);
|
||||||
|
}
|
||||||
return $this->redis->setex($var, $ttl, $data);
|
return $this->redis->setex($var, $ttl, $data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue