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