Skip to content

Commit

Permalink
Avoid unnessary queuing of *concurrency processes on resume
Browse files Browse the repository at this point in the history
  • Loading branch information
megawac committed Dec 1, 2016
1 parent 7d51d6f commit 834d5ac
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions lib/internal/queue.js
Expand Up @@ -149,12 +149,7 @@ export default function queue(worker, concurrency, payload) {
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 <= resumeCount; w++) {
setImmediate(q.process);
}
setImmediate(q.process);
}
};
return q;
Expand Down

0 comments on commit 834d5ac

Please sign in to comment.