mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-05 09:41:40 +09:00
Fix #621 incorrect incr/decr of key group versions in Redis cache
This commit is contained in:
parent
eb467b5799
commit
760bd01ec4
1 changed files with 6 additions and 1 deletions
7
common/framework/drivers/cache/redis.php
vendored
7
common/framework/drivers/cache/redis.php
vendored
|
|
@ -143,6 +143,10 @@ class Redis implements \Rhymix\Framework\Drivers\CacheInterface
|
|||
{
|
||||
return null;
|
||||
}
|
||||
if (ctype_digit($value))
|
||||
{
|
||||
return $value;
|
||||
}
|
||||
|
||||
$value = unserialize($value);
|
||||
if ($value === false)
|
||||
|
|
@ -168,7 +172,8 @@ class Redis implements \Rhymix\Framework\Drivers\CacheInterface
|
|||
{
|
||||
try
|
||||
{
|
||||
return $this->_conn->setex($key, $ttl, serialize($value)) ? true : false;
|
||||
$value = (is_scalar($value) && ctype_digit($value)) ? $value : serialize($value);
|
||||
return $this->_conn->setex($key, $ttl, $value) ? true : false;
|
||||
}
|
||||
catch (\RedisException $e)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue