From e9e9b6a4b63aa32e9623337ed3ea2838414cb5b1 Mon Sep 17 00:00:00 2001
From: Morris Jobke <hey@morrisjobke.de>
Date: Wed, 22 May 2019 12:19:07 +0200
Subject: Allow redis cluster to use password

Signed-off-by: Morris Jobke <hey@morrisjobke.de>
---
 lib/private/RedisFactory.php | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

(limited to 'lib/private/RedisFactory.php')

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']);
-- 
cgit v1.2.3