Skip to content

Commit

Permalink
fix unneeded iteration in queue.resume. Fixes #758
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexander Early committed May 20, 2015
1 parent 39715f4 commit 91f6fb3
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/async.js
Original file line number Diff line number Diff line change
Expand Up @@ -974,9 +974,10 @@
resume: function () {
if (q.paused === false) { return; }
q.paused = false;
var resumeCount = Math.min(q.concurrency, q.tasks.length);
// Need to call q.process once per concurrent
// worker to preserve full concurrency after pause
for (var w = 1; w <= q.concurrency; w++) {
for (var w = 1; w <= resumeCount; w++) {
async.setImmediate(q.process);
}
}
Expand Down

0 comments on commit 91f6fb3

Please sign in to comment.