updated error when no test db is defined -- also made an invalid "db" option a fatal error. Before, it was just defaulting to 0! Wiped out my test db hahaha

v1.18.x
Julian Lam 11 years ago
parent e8c4bda984
commit de66ee1a89

@ -23,7 +23,7 @@
errorText = 'redis_test database is not defined';
winston.info(
"\n===========================================================\n"+
"Please, add parameters for test database in config.js\n"+
"Please, add parameters for test database in config.json\n"+
"For example:\n"+
'"redis_test": {' + '\n' +
' "host": "127.0.0.1",' + '\n' +

@ -20,14 +20,12 @@
RedisDB.auth(nconf.get('redis:password'));
}
var db = nconf.get('redis:database');
var db = parseInt(nconf.get('redis:database'), 10);
if (db){
RedisDB.select(db, function(error){
if(error !== null){
winston.err(error);
if (global.env !== 'production') {
throw new Error(error);
}
winston.error("NodeBB could not connect to your Redis database. Redis returned the following error: " + error.message);
process.exit();
}
});
}

Loading…
Cancel
Save