From 4494be4aee8d0adaa378e7585c9edf84754f9134 Mon Sep 17 00:00:00 2001 From: Sergey Konovalov Date: Thu, 21 Nov 2019 11:21:41 +0300 Subject: [PATCH] [config] Add options for Redis client; Fix ONLYOFFICE/DocumentServer#353 --- Common/config/default.json | 3 ++- DocService/sources/pubsubRedis.js | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Common/config/default.json b/Common/config/default.json index 51e85e8d8..fb10950e9 100644 --- a/Common/config/default.json +++ b/Common/config/default.json @@ -119,7 +119,8 @@ "name": "redis", "prefix": "ds:", "host": "localhost", - "port": 6379 + "port": 6379, + "options": {} }, "pubsub": { "name": "pubsubRabbitMQ", diff --git a/DocService/sources/pubsubRedis.js b/DocService/sources/pubsubRedis.js index a41bb89fe..4ac5a6c51 100644 --- a/DocService/sources/pubsubRedis.js +++ b/DocService/sources/pubsubRedis.js @@ -41,11 +41,12 @@ var redis = require(config.get('name')); var cfgRedisPrefix = config.get('prefix'); var cfgRedisHost = config.get('host'); var cfgRedisPort = config.get('port'); +var cfgRedisOptions = config.get('options'); var channelName = cfgRedisPrefix + constants.REDIS_KEY_PUBSUB; function createClientRedis() { - var redisClient = redis.createClient(cfgRedisPort, cfgRedisHost, {}); + var redisClient = redis.createClient(cfgRedisPort, cfgRedisHost, cfgRedisOptions); redisClient.on('error', function(err) { logger.error('redisClient error %s', err.toString()); });