]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix(ratelimit): Only use memory cache backend for redis 40300/head
authorJoas Schilling <coding@schilljs.com>
Tue, 29 Aug 2023 06:04:25 +0000 (08:04 +0200)
committerbackportbot-nextcloud[bot] <backportbot-nextcloud[bot]@users.noreply.github.com>
Wed, 6 Sep 2023 15:42:21 +0000 (15:42 +0000)
Signed-off-by: Anna Larch <anna@nextcloud.com>
lib/private/Server.php

index 68bf3d76f362a283cae70feccb35f53b0e0cb188..2d2f2cd9a9bedbe01cc0c69c3a7553f1148b0295 100644 (file)
@@ -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),