From efcc42f1702265a1067f318c909eaece0f98e234 Mon Sep 17 00:00:00 2001 From: barisusakli Date: Mon, 30 Jun 2014 14:07:30 -0400 Subject: [PATCH] added eachLimit to upgrade script --- src/upgrade.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/upgrade.js b/src/upgrade.js index efe19d5011..6be807853c 100644 --- a/src/upgrade.js +++ b/src/upgrade.js @@ -769,7 +769,7 @@ Upgrade.upgrade = function(callback) { return callback(); } - async.each(pids, function(pid, next) { + async.eachLimit(pids, 10, function(pid, next) { Posts.getPostField(pid, 'votes', function(err, votes) { if (err) { return next(err); @@ -790,7 +790,7 @@ Upgrade.upgrade = function(callback) { return Upgrade.update(thisSchemaDate, next); } - async.each(tids, upgradeTopic, function(err) { + async.eachLimit(tids, 10, upgradeTopic, function(err) { if (err) { winston.error('[2014/6/6] Error encountered while upgrading topics'); return next(err);