Skip to content

Commit a4893f6

Browse files
committed
fix(ratelimit): Only use memory cache backend for redis
Signed-off-by: Joas Schilling <coding@schilljs.com>
1 parent 2220620 commit a4893f6

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

lib/private/Server.php

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

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

0 commit comments

Comments
 (0)