Skip to content

Commit

Permalink
fix(ratelimit): Only use memory cache backend for redis
Browse files Browse the repository at this point in the history
Signed-off-by: Anna Larch <anna@nextcloud.com>
  • Loading branch information
nickvergessen authored and miaulalala committed Sep 6, 2023
1 parent 892952f commit 7ae9eac
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 @@ -796,8 +796,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 7ae9eac

Please sign in to comment.