Baris Usakli 11 years ago
commit 0179a55ee4

@ -23,7 +23,7 @@
errorText = 'redis_test database is not defined'; errorText = 'redis_test database is not defined';
winston.info( winston.info(
"\n===========================================================\n"+ "\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"+ "For example:\n"+
'"redis_test": {' + '\n' + '"redis_test": {' + '\n' +
' "host": "127.0.0.1",' + '\n' + ' "host": "127.0.0.1",' + '\n' +

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

Loading…
Cancel
Save