Skip to content
Snippets Groups Projects
Unverified Commit 4f0fae8f authored by Roeland Jago Douma's avatar Roeland Jago Douma
Browse files

Actually set the TTL on redis set


Else well the keys remain for ever and ever.

Signed-off-by: default avatarRoeland Jago Douma <roeland@famdouma.nl>
parent fbbb48fc
No related branches found
No related tags found
No related merge requests found
......@@ -101,7 +101,13 @@ class Redis extends Cache implements IMemcacheTTL {
if (!is_int($value)) {
$value = json_encode($value);
}
return self::$cache->setnx($this->getPrefix() . $key, $value);
$args = ['nx'];
if ($ttl !== 0 && is_int($ttl)) {
$args['ex'] = $ttl;
}
return self::$cache->set($this->getPrefix() . $key, $value, $args);
}
/**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment