Skip to content

Commit

Permalink
[config] Add options for Redis client; Fix ONLYOFFICE/DocumentServer#353
Browse files Browse the repository at this point in the history
  • Loading branch information
konovalovsergey committed Nov 21, 2019
1 parent f784264 commit 4494be4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion Common/config/default.json
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,8 @@
"name": "redis",
"prefix": "ds:",
"host": "localhost",
"port": 6379
"port": 6379,
"options": {}
},
"pubsub": {
"name": "pubsubRabbitMQ",
Expand Down
3 changes: 2 additions & 1 deletion DocService/sources/pubsubRedis.js
Original file line number Diff line number Diff line change
Expand Up @@ -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());
});
Expand Down

0 comments on commit 4494be4

Please sign in to comment.