From eadc6b838be9dcb0c37a85818176670c5f3546d5 Mon Sep 17 00:00:00 2001 From: Douglas Lovell Date: Tue, 5 Mar 2019 11:24:10 -0300 Subject: [PATCH] Merge branch 'dcl-i1507e' GitOrigin-RevId: 6368f274c2b19d12c571cf065291805a4ff50a4e --- services/web/scripts/remove_brand_variation_ids.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/services/web/scripts/remove_brand_variation_ids.js b/services/web/scripts/remove_brand_variation_ids.js index b829e9de23..9ddf809740 100644 --- a/services/web/scripts/remove_brand_variation_ids.js +++ b/services/web/scripts/remove_brand_variation_ids.js @@ -17,6 +17,7 @@ const minimist = require('minimist') const argv = minimist(process.argv.slice(2)) const bvId = argv._[0] const commit = argv.commit !== undefined +const maxParallel = 4 console.log( (commit ? 'Remove' : 'Dry run for remove') + @@ -35,8 +36,9 @@ db.projects.find( function processRemovals(err, projects) { if (err) throw err - async.mapSeries( + async.eachLimit( projects, + maxParallel, function(project, cb) { count += 1 console.log( @@ -54,7 +56,7 @@ function processRemovals(err, projects) { cb ) } else { - cb() + async.setImmediate(cb) } }, function(err) {