mirror of
https://github.com/samsonjs/kwikemon.git
synced 2026-03-25 09:05:51 +00:00
fix Redis.createClient call & reading config
This commit is contained in:
parent
6cf290baf9
commit
7d398de64f
1 changed files with 4 additions and 3 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue