From 7d398de64f191f206a3c4fb9ee94698f535d93c5 Mon Sep 17 00:00:00 2001 From: Sami Samhuri Date: Sat, 24 Aug 2013 17:16:21 -0700 Subject: [PATCH] fix Redis.createClient call & reading config --- kwikemon.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/kwikemon.js b/kwikemon.js index 1d4af98..29d0e8c 100644 --- a/kwikemon.js +++ b/kwikemon.js @@ -39,12 +39,13 @@ function redis(newRedis) { else { if (!redisClient) { var configFile = process.env.HOME + '/.kwikemon.toml' - , config = null + , config = {} ; if (fs.existsSync(configFile)) { - config = toml.parse(fs.readFileSync(configFile)).redis; + config = toml.parse(fs.readFileSync(configFile)); } - redisClient = Redis.createClient(config); + config.redis = config.redis || {}; + redisClient = Redis.createClient(config.redis.port, config.redis.host, config.redis.options); } return redisClient; }