From 379bdd12e05186b45074bde80d4af1fdf69e3fc7 Mon Sep 17 00:00:00 2001 From: Julian Lam Date: Mon, 27 Apr 2015 22:51:44 -0400 Subject: [PATCH] fixed improper parsing of url in loader, and updated mongo init to not send anything in cb except err. Also updated webserver init so that it doesn't expect stuff from static:app.preload --- loader.js | 6 +++--- src/database/mongo.js | 4 +++- src/webserver.js | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/loader.js b/loader.js index 56f09f19d2..9435b63f3a 100644 --- a/loader.js +++ b/loader.js @@ -188,12 +188,12 @@ function forkWorker(index, isPrimary) { } function getPorts() { - var url = nconf.get('url'); - if (!url) { + var _url = nconf.get('url'); + if (!_url) { console.log('[cluster] url is undefined, please check your config.json'); process.exit(); } - var urlObject = url.parse(url); + var urlObject = url.parse(_url); var port = nconf.get('port') || nconf.get('PORT') || urlObject.port || 4567; if (!Array.isArray(port)) { port = [port]; diff --git a/src/database/mongo.js b/src/database/mongo.js index a9ada1d424..e031132b99 100644 --- a/src/database/mongo.js +++ b/src/database/mongo.js @@ -142,7 +142,9 @@ async.apply(createIndex, 'searchpost', {content: 'text', uid: 1, cid: 1}, {background: true}), async.apply(createIndex, 'searchpost', {id: 1}, {background: true}) - ], callback); + ], function(err) { + callback(err); + }); } function createIndex(collection, index, options, callback) { diff --git a/src/webserver.js b/src/webserver.js index 4e7dc896a8..7e8e01ed92 100644 --- a/src/webserver.js +++ b/src/webserver.js @@ -106,7 +106,7 @@ function initializeNodeBB(callback) { middleware: middleware }, next); }, - function(results, next) { + function(next) { routes(app, middleware); next(); }