Skip to content

Commit

Permalink
Fix cache redis ttl to work
Browse files Browse the repository at this point in the history
* backported redis cache ttl does not work from
  bcit-ci/CodeIgniter#6231
  • Loading branch information
mckaygerhard committed Feb 6, 2024
1 parent 0175908 commit d26b4cc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions appsys/libraries/Cache/drivers/Cache_redis.php
Original file line number Diff line number Diff line change
Expand Up @@ -214,6 +214,10 @@ public function save($id, $data, $ttl = 60, $raw = FALSE)
$this->_redis->{static::$_sRemove_name}('_ci_redis_serialized', $id);
}

if (is_numeric($ttl)) {
$this->_redis->expireAt($id, time() + $ttl);
}

return $this->_redis->set($id, $data, $ttl);
}

Expand Down

0 comments on commit d26b4cc

Please sign in to comment.