diff options
author | Joas Schilling <coding@schilljs.com> | 2023-08-29 08:04:25 +0200 |
---|---|---|
committer | Anna Larch <anna@nextcloud.com> | 2023-09-06 18:09:54 +0200 |
commit | a1cb0b44600aebb3037833adad01c100c7a08987 (patch) | |
tree | 97f1179a68cdf271488112eb7f157631c529cf83 | |
parent | 0be524db6dc49f1c35997f02263be2948f81f8f9 (diff) | |
download | nextcloud-server-a1cb0b44600aebb3037833adad01c100c7a08987.tar.gz nextcloud-server-a1cb0b44600aebb3037833adad01c100c7a08987.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 b1f81ef3fd5..95f4939d9c0 100644 --- a/lib/private/Server.php +++ b/lib/private/Server.php @@ -844,8 +844,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), |