Skip to content
This repository has been archived by the owner on Aug 23, 2022. It is now read-only.

CONCURRENCY_LIMIT ignored #79

Open
lart2150 opened this issue Mar 7, 2022 · 0 comments
Open

CONCURRENCY_LIMIT ignored #79

lart2150 opened this issue Mar 7, 2022 · 0 comments

Comments

@lart2150
Copy link

lart2150 commented Mar 7, 2022

      if (queue.length > CONCURRENCY_LIMIT) {
        await queue.shift()
      }

queue.shift() does not return a promise so this does not wait.

you could do something like

      while (queue.length > CONCURRENCY_LIMIT) {
        await sleep(Math.random(100))
      }

and then in the finally add
queue.pop();

This would be a non deterministic queue but it's a simple change to support CONCURRENCY_LIMIT

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant