Ver código fonte

Merge pull request #40300 from nextcloud/backport/40293/stable27

[stable27] fix(ratelimit): Only use memory cache backend for redis
Andy Scherzinger 1 ano atrás
pai
commit
dd52ddf4f8
1 arquivos alterados com 2 adições e 2 exclusões
  1. 2 2
      lib/private/Server.php

+ 2 - 2
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),