mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-02 20:16:04 +01:00
parallel startup
This commit is contained in:
13
app.js
13
app.js
@@ -181,13 +181,14 @@ function start() {
|
||||
|
||||
async.waterfall([
|
||||
async.apply(db.init),
|
||||
async.apply(db.checkCompatibility),
|
||||
function (next) {
|
||||
require('./src/meta').configs.init(next);
|
||||
},
|
||||
var meta = require('./src/meta');
|
||||
async.parallel([
|
||||
async.apply(db.checkCompatibility),
|
||||
async.apply(meta.configs.init),
|
||||
function (next) {
|
||||
if (nconf.get('dep-check') === undefined || nconf.get('dep-check') !== false) {
|
||||
require('./src/meta').dependencies.check(next);
|
||||
meta.dependencies.check(next);
|
||||
} else {
|
||||
winston.warn('[init] Dependency checking skipped!');
|
||||
setImmediate(next);
|
||||
@@ -195,6 +196,10 @@ function start() {
|
||||
},
|
||||
function (next) {
|
||||
require('./src/upgrade').check(next);
|
||||
}
|
||||
], function (err) {
|
||||
next(err);
|
||||
});
|
||||
},
|
||||
function (next) {
|
||||
var webserver = require('./src/webserver');
|
||||
|
||||
@@ -167,12 +167,12 @@
|
||||
|
||||
module.checkCompatibility = function (callback) {
|
||||
var mongoPkg = require.main.require('./node_modules/mongodb/package.json');
|
||||
var err = semver.lt(mongoPkg.version, '2.0.0') ? new Error('The `mongodb` package is out-of-date, please run `./nodebb setup` again.') : null;
|
||||
|
||||
if (err) {
|
||||
err.stacktrace = false;
|
||||
if (semver.lt(mongoPkg.version, '2.0.0')) {
|
||||
return callback(new Error('The `mongodb` package is out-of-date, please run `./nodebb setup` again.'));
|
||||
}
|
||||
callback(err);
|
||||
|
||||
callback();
|
||||
};
|
||||
|
||||
module.info = function (db, callback) {
|
||||
|
||||
@@ -118,11 +118,10 @@
|
||||
}
|
||||
|
||||
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;
|
||||
return callback(new Error('Your Redis version is not new enough to support NodeBB, please upgrade Redis to v2.8.9 or higher.'));
|
||||
}
|
||||
|
||||
callback(err);
|
||||
callback();
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user