From 52d68d310908fe8e74ffe57ca9b61286da94c667 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Tue, 29 Aug 2023 08:04:25 +0200 Subject: [PATCH] fix(ratelimit): Only use memory cache backend for redis Signed-off-by: Anna Larch --- lib/private/Server.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/private/Server.php b/lib/private/Server.php index 68bf3d76f362a..2d2f2cd9a9bed 100644 --- a/lib/private/Server.php +++ b/lib/private/Server.php @@ -846,8 +846,8 @@ public function __construct($webRoot, \OC\Config $config) { $this->registerDeprecatedAlias('Search', ISearch::class); $this->registerService(\OC\Security\RateLimiting\Backend\IBackend::class, function ($c) { - $cacheFactory = $c->get(ICacheFactory::class); - if ($cacheFactory->isAvailable()) { + $config = $c->get(\OCP\IConfig::class); + if (ltrim($config->getSystemValueString('memcache.distributed', ''), '\\') === \OC\Memcache\Redis::class) { $backend = new \OC\Security\RateLimiting\Backend\MemoryCacheBackend( $c->get(AllConfig::class), $this->get(ICacheFactory::class),