Merge branch 'ticket/17358' into ticket/17358-master

This commit is contained in:
rxu 2024-06-30 13:16:28 +07:00
commit 89ce42ffa2
No known key found for this signature in database
GPG key ID: 955F0567380E586A

View file

@ -123,15 +123,17 @@ class redis extends \phpbb\cache\driver\memory
} }
/** /**
* {@inheritDoc} * 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
*
* {@inheritDoc}
*/
protected function _write(string $var, $data, int $ttl = 2592000): bool protected function _write(string $var, $data, int $ttl = 2592000): bool
{ {
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);
} }
/** /**