fix crash when redis server isn't running

v1.18.x
psychobunny 10 years ago
parent ed72bacb1f
commit 78ea462620

@ -167,7 +167,6 @@
};
module.checkCompatibility = function(callback) {
// For MongoDB, we need to ensure that the mongodb package is >= 2.0.0
var mongoPkg = require.main.require('./node_modules/mongodb/package.json'),
err = semver.lt(mongoPkg.version, '2.0.0') ? new Error('The `mongodb` package is out-of-date, please run `./nodebb setup` again.') : null;

@ -113,12 +113,16 @@
};
module.checkCompatibility = function(callback) {
// Redis requires v2.8.9
module.info(module.client, function(err, info) {
var err = semver.lt(info.redis_version, '2.8.9') ? new Error('Your Redis version is not new enough to support NodeBB, please upgrade Redis to v2.8.9 or higher.') : null;
if (err) {
return callback(err);
}
if (semver.lt(info.redis_version, '2.8.9')) {
err = new Error('Your Redis version is not new enough to support NodeBB, please upgrade Redis to v2.8.9 or higher.');
err.stacktrace = false;
}
callback(err);
});
};

Loading…
Cancel
Save