diff options
-rw-r--r-- | lib/internal/queue.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/internal/queue.js b/lib/internal/queue.js index 4f57edb..1a3f4cb 100644 --- a/lib/internal/queue.js +++ b/lib/internal/queue.js @@ -65,7 +65,9 @@ export default function queue(worker, concurrency, payload) { var task = tasks[i]; var index = indexOf(workersList, task, 0); - if (index >= 0) { + if (index === 0) { + workersList.shift(); + } else if (index > 0) { workersList.splice(index, 1); } |