Skip to content

Commit

Permalink
Merge pull request #40304 from nextcloud/backport/40293/stable25
Browse files Browse the repository at this point in the history
[stable25] fix(ratelimit): Only use memory cache backend for redis
  • Loading branch information
tobiasKaminsky authored Sep 7, 2023
2 parents 57e32f1 + c2d7e9b commit a1d4f51
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 @@ -839,8 +839,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 a1d4f51

Please sign in to comment.