Skip to content

Commit 165aeeb

Browse files
authored
Merge pull request #40293 from nextcloud/bugfix/noid/only-use-memory-cache-backend-for-redis
fix(ratelimit): Only use memory cache backend for redis
2 parents 8ac768c + eb3e715 commit 165aeeb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/private/Server.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -786,8 +786,8 @@ public function __construct($webRoot, \OC\Config $config) {
786786
$this->registerDeprecatedAlias('Search', ISearch::class);
787787

788788
$this->registerService(\OC\Security\RateLimiting\Backend\IBackend::class, function ($c) {
789-
$cacheFactory = $c->get(ICacheFactory::class);
790-
if ($cacheFactory->isAvailable()) {
789+
$config = $c->get(\OCP\IConfig::class);
790+
if (ltrim($config->getSystemValueString('memcache.distributed', ''), '\\') === \OC\Memcache\Redis::class) {
791791
$backend = new \OC\Security\RateLimiting\Backend\MemoryCacheBackend(
792792
$c->get(AllConfig::class),
793793
$this->get(ICacheFactory::class),

0 commit comments

Comments
 (0)