aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJohn Molakvoæ <skjnldsv@users.noreply.github.com>2021-07-23 14:25:59 +0200
committerGitHub <noreply@github.com>2021-07-23 14:25:59 +0200
commit229bfcbab56e2de473d2d34bb7d86b5665d4ab35 (patch)
tree35325fd808aed8bd251ef322396c1357ed367927
parent74e7934f04d967b610f2abf51efe16bbbfcc7f3f (diff)
parent41ddbec40f1b2c59a68464efc8ba7b127cda444e (diff)
downloadnextcloud-server-229bfcbab56e2de473d2d34bb7d86b5665d4ab35.tar.gz
nextcloud-server-229bfcbab56e2de473d2d34bb7d86b5665d4ab35.zip
Merge pull request #28129 from nextcloud/bugfix/noid/redis-allow-defaults
Allow empty Redis config
-rw-r--r--lib/private/RedisFactory.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/private/RedisFactory.php b/lib/private/RedisFactory.php
index 7609a75d52d..8160f2569e0 100644
--- a/lib/private/RedisFactory.php
+++ b/lib/private/RedisFactory.php
@@ -51,10 +51,6 @@ class RedisFactory {
? $this->config->getValue('redis.cluster', [])
: $this->config->getValue('redis', []);
- if (empty($config)) {
- throw new \Exception('Redis config is empty');
- }
-
if ($isCluster && !class_exists('RedisCluster')) {
throw new \Exception('Redis Cluster support is not available');
}
@@ -86,6 +82,10 @@ class RedisFactory {
// cluster config
if ($isCluster) {
+ if (!isset($config['seeds'])) {
+ throw new \Exception('Redis cluster config is missing the "seeds" attribute');
+ }
+
// Support for older phpredis versions not supporting connectionParameters
if ($connectionParameters !== null) {
$this->instance = new \RedisCluster(null, $config['seeds'], $timeout, $readTimeout, false, $auth, $connectionParameters);