From a654a2a5fe3b108b2db956c4843aabb76ed3356f Mon Sep 17 00:00:00 2001 From: Ben Lubar Date: Thu, 27 Oct 2016 18:44:45 -0500 Subject: [PATCH] Work around MongoDB bug (see https://github.com/NodeBB/NodeBB/pull/5050#issuecomment-256766439) --- src/upgrade.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/upgrade.js b/src/upgrade.js index 4eb030de81..9aa66e8f22 100644 --- a/src/upgrade.js +++ b/src/upgrade.js @@ -923,10 +923,11 @@ Upgrade.upgrade = function (callback) { return next(err); } - async.each(data, function (postData, next) { + async.eachSeries(data, function (postData, next) { if (!parseInt(postData.toPid, 10)) { return next(null); } + console.log('processing pid: ' + postData.pid + ' toPid: ' + postData.toPid); async.parallel([ async.apply(db.sortedSetAdd, 'pid:' + postData.toPid + ':replies', postData.timestamp, postData.pid), async.apply(db.incrObjectField, 'post:' + postData.toPid, 'replies')