aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Memcache
diff options
context:
space:
mode:
authorChristoph Wurst <christoph@winzerhof-wurst.at>2023-10-11 13:29:21 +0200
committerChristoph Wurst <christoph@winzerhof-wurst.at>2023-10-11 13:37:22 +0200
commitff672b11e2e9628fd721b097e6712f99cb9883f8 (patch)
treed744ed2ff6fdc453090b61c04b1efd9da4d8c153 /lib/private/Memcache
parent04db454e9fc57483595e90dee348904acd4315ca (diff)
downloadnextcloud-server-ff672b11e2e9628fd721b097e6712f99cb9883f8.tar.gz
nextcloud-server-ff672b11e2e9628fd721b097e6712f99cb9883f8.zip
feat: Add factory method for in-memory caches
Signed-off-by: Christoph Wurst <christoph@winzerhof-wurst.at>
Diffstat (limited to 'lib/private/Memcache')
-rw-r--r--lib/private/Memcache/Factory.php5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/private/Memcache/Factory.php b/lib/private/Memcache/Factory.php
index fa2dfeb75dd..16d6ae32f72 100644
--- a/lib/private/Memcache/Factory.php
+++ b/lib/private/Memcache/Factory.php
@@ -31,6 +31,7 @@
*/
namespace OC\Memcache;
+use OCP\Cache\CappedMemoryCache;
use OCP\Profiler\IProfiler;
use OCP\ICache;
use OCP\ICacheFactory;
@@ -184,6 +185,10 @@ class Factory implements ICacheFactory {
return $this->distributedCacheClass !== self::NULL_CACHE;
}
+ public function createInMemory(int $capacity = 512): ICache {
+ return new CappedMemoryCache($capacity);
+ }
+
/**
* Check if a local memory cache backend is available
*