Skip to content

Commit

Permalink
Merge pull request #40300 from nextcloud/backport/40293/stable27
Browse files Browse the repository at this point in the history
[stable27] fix(ratelimit): Only use memory cache backend for redis
  • Loading branch information
AndyScherzinger authored Sep 6, 2023
2 parents 42e70cf + 52d68d3 commit dd52ddf
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/private/Server.php
Original file line number Diff line number Diff line change
Expand Up @@ -846,8 +846,8 @@ public function __construct($webRoot, \OC\Config $config) {
$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),
Expand Down

0 comments on commit dd52ddf

Please sign in to comment.