Skip to content

Commit efe7912

Browse files
authored
Fix warning and ignored TTL in Redis cache driver.
1 parent 9018343 commit efe7912

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

system/libraries/Cache/drivers/Cache_redis.php

+2-1
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ public function get($key)
163163
{
164164
$data = $this->_redis->hMGet($key, array('__ci_type', '__ci_value'));
165165

166-
if ($value !== FALSE && $this->_redis->sIsMember('_ci_redis_serialized', $key))
166+
if ($data === FALSE || $this->_redis->sIsMember('_ci_redis_serialized', $key))
167167
{
168168
return FALSE;
169169
}
@@ -223,6 +223,7 @@ public function save($id, $data, $ttl = 60, $raw = FALSE)
223223
}
224224
else
225225
{
226+
$this->_redis->expireAt($id, time() + $ttl);
226227
$this->_redis->{static::$_sRemove_name}('_ci_redis_serialized', $id);
227228
}
228229

0 commit comments

Comments
 (0)