ajax-lives / NoRussian

Volunteer DoS tool via HTML + JS
GNU General Public License v3.0
371 stars 58 forks source link

CONCURRENCY_LIMIT ignored #79

Open lart2150 opened 2 years ago

lart2150 commented 2 years ago
      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