Skip to content

Node.js based forum software built for the modern web

parallel startup

Barış Soner Uşaklıe0501656b602
diff --git a/app.js b/app.js
index d4cc855de9..04a3c3d517 100644
--- a/app.js
+++ b/app.js
@@ -180,21 +180,26 @@ function start() {
});
async.waterfall([
- async.apply(db.init),
- async.apply(db.checkCompatibility),
- function (next) {
- require('./src/meta').configs.init(next);
- },
+ async.apply(db.init),
function (next) {
- if (nconf.get('dep-check') === undefined || nconf.get('dep-check') !== false) {
- require('./src/meta').dependencies.check(next);
- } else {
- winston.warn('[init] Dependency checking skipped!');
- setImmediate(next);
- }
- },
- function (next) {
- require('./src/upgrade').check(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) {
+ meta.dependencies.check(next);
+ } else {
+ winston.warn('[init] Dependency checking skipped!');
+ setImmediate(next);
+ }
+ },
+ function (next) {
+ require('./src/upgrade').check(next);
+ }
+ ], function (err) {
+ next(err);
+ });
},
function (next) {
var webserver = require('./src/webserver');
diff --git a/src/database/mongo.js b/src/database/mongo.js
index 5271202b25..2e09047da1 100644
--- a/src/database/mongo.js
+++ b/src/database/mongo.js
@@ -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) {
diff --git a/src/database/redis.js b/src/database/redis.js
index e6184db758..f1c00a2316 100644
--- a/src/database/redis.js
+++ b/src/database/redis.js
@@ -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();
});
};