diff options
author | Joas Schilling <coding@schilljs.com> | 2023-08-29 08:04:25 +0200 |
---|---|---|
committer | backportbot-nextcloud[bot] <backportbot-nextcloud[bot]@users.noreply.github.com> | 2023-09-06 15:42:21 +0000 |
commit | 52d68d310908fe8e74ffe57ca9b61286da94c667 (patch) | |
tree | d99acfd79bdf81d4f6507e38ab9cc7af455671b4 | |
parent | 325e42f2b3760dceb44e40eb5f7724b93d9e3105 (diff) | |
download | nextcloud-server-52d68d310908fe8e74ffe57ca9b61286da94c667.tar.gz nextcloud-server-52d68d310908fe8e74ffe57ca9b61286da94c667.zip |
fix(ratelimit): Only use memory cache backend for redis
Signed-off-by: Anna Larch <anna@nextcloud.com>
-rw-r--r-- | lib/private/Server.php | 4 |
1 files changed, 2 insertions, 2 deletions
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), |