diff options
author | Robin Appelman <robin@icewind.nl> | 2024-07-10 12:42:46 +0200 |
---|---|---|
committer | Robin Appelman <robin@icewind.nl> | 2024-08-07 19:41:41 +0200 |
commit | cd9cc01b7739535cc9246103f90ae2d02d8ea217 (patch) | |
tree | 6fbbc9cdce6182ed130ef4ebcc40afa7c819f19c /lib/private/Memcache | |
parent | 0050e1e2199bc0b99dcd9a03ed55e850cc323ce2 (diff) | |
download | nextcloud-server-cd9cc01b7739535cc9246103f90ae2d02d8ea217.tar.gz nextcloud-server-cd9cc01b7739535cc9246103f90ae2d02d8ea217.zip |
fix: set default TTL for APCu cache as per docs
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'lib/private/Memcache')
-rw-r--r-- | lib/private/Memcache/APCu.php | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/private/Memcache/APCu.php b/lib/private/Memcache/APCu.php index 7f6a73354ee..9eb2ee0b2bf 100644 --- a/lib/private/Memcache/APCu.php +++ b/lib/private/Memcache/APCu.php @@ -25,6 +25,9 @@ class APCu extends Cache implements IMemcache { } public function set($key, $value, $ttl = 0) { + if ($ttl === 0) { + $ttl = self::DEFAULT_TTL; + } return apcu_store($this->getPrefix() . $key, $value, $ttl); } @@ -56,6 +59,9 @@ class APCu extends Cache implements IMemcache { * @return bool */ public function add($key, $value, $ttl = 0) { + if ($ttl === 0) { + $ttl = self::DEFAULT_TTL; + } return apcu_add($this->getPrefix() . $key, $value, $ttl); } |