Fix dequeue.

This commit is contained in:
John-David Dalton
2014-05-01 01:48:25 -07:00
parent d5562767a2
commit 1316ce5ca8

View File

@@ -322,7 +322,7 @@ function onStart(error, res, body) {
}
/**
* The `request.post` callback used by `check`.
* The `request.post` callback used by `Job#status`.
*
* @private
* @param {Object} [error] The error object.
@@ -503,7 +503,8 @@ function run(platforms, onComplete) {
});
var dequeue = function() {
while (queue.length && running++ < throttled) {
while (queue.length && (running < throttled)) {
running++;
queue.shift().start();
}
};