aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/RedisFactory.php
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2019-05-22 12:19:07 +0200
committerMorris Jobke <hey@morrisjobke.de>2019-05-22 12:19:07 +0200
commite9e9b6a4b63aa32e9623337ed3ea2838414cb5b1 (patch)
tree725b03c7b608ce4f0932953e8a3700eb6c699976 /lib/private/RedisFactory.php
parentac92603014268a13a9b31beb8bd9dd26cbd84282 (diff)
downloadnextcloud-server-e9e9b6a4b63aa32e9623337ed3ea2838414cb5b1.tar.gz
nextcloud-server-e9e9b6a4b63aa32e9623337ed3ea2838414cb5b1.zip
Allow redis cluster to use password
Signed-off-by: Morris Jobke <hey@morrisjobke.de>
Diffstat (limited to 'lib/private/RedisFactory.php')
-rw-r--r--lib/private/RedisFactory.php6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/private/RedisFactory.php b/lib/private/RedisFactory.php
index 22d02e07c29..2224eaca79c 100644
--- a/lib/private/RedisFactory.php
+++ b/lib/private/RedisFactory.php
@@ -56,7 +56,11 @@ class RedisFactory {
} else {
$readTimeout = null;
}
- $this->instance = new \RedisCluster(null, $config['seeds'], $timeout, $readTimeout);
+ if (isset($config['password']) && $config['password'] !== '') {
+ $this->instance = new \RedisCluster(null, $config['seeds'], $timeout, $readTimeout, false, $config['password']);
+ } else {
+ $this->instance = new \RedisCluster(null, $config['seeds'], $timeout, $readTimeout);
+ }
if (isset($config['failover_mode'])) {
$this->instance->setOption(\RedisCluster::OPT_SLAVE_FAILOVER, $config['failover_mode']);