mirror of
https://github.com/nextcloud/server.git
synced 2026-06-12 18:21:40 -04:00
Merge pull request #24800 from nextcloud/backport/24796/stable18
[stable18] Actually set the TTL on redis set
This commit is contained in:
commit
046f913034
1 changed files with 7 additions and 1 deletions
|
|
@ -100,7 +100,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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Reference in a new issue