From: Joas Schilling Date: Tue, 29 Aug 2023 06:04:25 +0000 (+0200) Subject: fix(ratelimit): Only use memory cache backend for redis X-Git-Tag: v27.1.0rc2~8^2 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=52d68d310908fe8e74ffe57ca9b61286da94c667;p=nextcloud-server.git fix(ratelimit): Only use memory cache backend for redis Signed-off-by: Anna Larch --- diff --git a/lib/private/Server.php b/lib/private/Server.php index 68bf3d76f36..2d2f2cd9a9b 100644 --- a/lib/private/Server.php +++ b/lib/private/Server.php @@ -846,8 +846,8 @@ class Server extends ServerContainer implements IServerContainer { $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),