mirror of
https://github.com/nextcloud/server.git
synced 2026-05-28 04:32:30 -04:00
Allow empty Redis config
When Redis config is empty, use defaults. However when a Redis cluster config is specified, the "seeds" attribute is mandatory. Signed-off-by: Vincent Petry <vincent@nextcloud.com>
This commit is contained in:
parent
f19f9e1927
commit
d5b38ed5f8
1 changed files with 4 additions and 4 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue