diff options
author | Christoph Wurst <ChristophWurst@users.noreply.github.com> | 2023-10-13 13:52:14 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-10-13 13:52:14 +0200 |
commit | cdc2f38a511a2665951f6eb8056d6077f70151ed (patch) | |
tree | 6d0e11d4cbcd73e34d101ba886037b0281d92542 /lib/private | |
parent | 160a2b71209fa4ec9f9513ba441335757a31b198 (diff) | |
parent | ff672b11e2e9628fd721b097e6712f99cb9883f8 (diff) | |
download | nextcloud-server-cdc2f38a511a2665951f6eb8056d6077f70151ed.tar.gz nextcloud-server-cdc2f38a511a2665951f6eb8056d6077f70151ed.zip |
Merge pull request #40868 from nextcloud/feat/in-memory-cache-factory
feat: Add factory method for in-memory caches
Diffstat (limited to 'lib/private')
-rw-r--r-- | lib/private/Memcache/Factory.php | 5 |
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 * |