mirror of
https://github.com/NodeBB/NodeBB.git
synced 2026-03-06 20:41:17 +01:00
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
This commit is contained in:
@@ -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();
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user