diff --git a/config_example.json b/config_example.json index 6e5e501e..60d27ddd 100644 --- a/config_example.json +++ b/config_example.json @@ -53,7 +53,8 @@ "redis": { "host": "127.0.0.1", - "port": 6379 + "port": 6379, + "password": "" }, "switching": { diff --git a/init.js b/init.js index 1abe554e..f2fd0a2a 100644 --- a/init.js +++ b/init.js @@ -203,6 +203,12 @@ var spawnPoolWorkers = function(){ } else if (!connection) { redisConfig = pcfg.redis; connection = redis.createClient(redisConfig.port, redisConfig.host); + if (redisConfig.password != "") { + connection.auth(redisConfig.password); + connection.on("error", function (err) { + logger.error("redis", coin, "An error occured while attempting to authenticate redis: " + err); + }); + } connection.on('ready', function(){ logger.debug('PPLNT', coin, 'TimeShare processing setup with redis (' + redisConfig.host + ':' + redisConfig.port + ')');