Merge pull request #24799 from nextcloud/backport/24796/stable19

[stable19] Actually set the TTL on redis set
This commit is contained in:
Julius Härtl 2020-12-21 16:01:09 +01:00 committed by GitHub
commit 8b15f820a1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 1 deletions

View File

@ -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);
}
/**