Merge pull request #40293 from nextcloud/bugfix/noid/only-use-memory-cache-backend-for-redis

fix(ratelimit): Only use memory cache backend for redis
This commit is contained in:
Anna 2023-09-06 17:25:36 +02:00 committed by GitHub
commit 165aeeb7f0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -786,8 +786,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),