mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 08:36:12 +01:00
feat: #9508, add cluster support
This commit is contained in:
@@ -12,7 +12,9 @@ connection.connect = async function (options) {
|
||||
const redis_socket_or_host = options.host;
|
||||
|
||||
let cxn;
|
||||
if (redis_socket_or_host && String(redis_socket_or_host).indexOf('/') >= 0) {
|
||||
if (options.cluster) {
|
||||
cxn = new Redis.Cluster(options.cluster, options.options);
|
||||
} else if (redis_socket_or_host && String(redis_socket_or_host).indexOf('/') >= 0) {
|
||||
// If redis.host contains a path name character, use the unix dom sock connection. ie, /tmp/redis.sock
|
||||
cxn = new Redis({
|
||||
...options.options,
|
||||
|
||||
Reference in New Issue
Block a user