mirror of
https://github.com/samsonjs/kwikemon.git
synced 2026-04-27 15:07:45 +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 {
|
else {
|
||||||
if (!redisClient) {
|
if (!redisClient) {
|
||||||
var configFile = process.env.HOME + '/.kwikemon.toml'
|
var configFile = process.env.HOME + '/.kwikemon.toml'
|
||||||
, config = null
|
, config = {}
|
||||||
;
|
;
|
||||||
if (fs.existsSync(configFile)) {
|
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;
|
return redisClient;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue