Skip to content

Commit

Permalink
Merge pull request #40293 from nextcloud/bugfix/noid/only-use-memory-…
Browse files Browse the repository at this point in the history
…cache-backend-for-redis

fix(ratelimit): Only use memory cache backend for redis
  • Loading branch information
miaulalala committed Sep 6, 2023
2 parents 8ac768c + eb3e715 commit 165aeeb
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 @@ -786,8 +786,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 165aeeb

Please sign in to comment.