fixing nconf issue where redis js was requiring redis configs before they were defined

This commit is contained in:
Julian Lam
2013-08-23 16:25:16 -04:00
parent 4d11fba20a
commit aeebd069e2
2 changed files with 9 additions and 7 deletions

View File

@@ -3,7 +3,7 @@
nconf = require('nconf'),
utils = require('./../public/src/utils.js'),
winston = require('winston');
RedisDB.exports = redis.createClient(nconf.get('redis:port'), nconf.get('redis:host'));
if(nconf.get('redis:password')) {
@@ -40,7 +40,7 @@
RedisDB.exports.hmget(key, fields, function(err, data) {
if(err === null) {
var returnData = {};
for(var i=0, ii=fields.length; i<ii; ++i) {
returnData[fields[i]] = data[i];
}
@@ -51,8 +51,8 @@
console.log(err);
callback(err, null);
}
});
}
});
}