1
This commit is contained in:
@@ -2,9 +2,8 @@ export async function sleep_ms(ms) {
|
||||
await new Promise((resolve) => setTimeout(resolve, ms));
|
||||
}
|
||||
|
||||
export async function map_limit(items, limit, worker) {
|
||||
export async function map_limit(items, worker) {
|
||||
const list = Array.isArray(items) ? items : [];
|
||||
const n = Math.max(1, Number(limit || 1));
|
||||
|
||||
const res = new Array(list.length);
|
||||
let idx = 0;
|
||||
@@ -18,7 +17,7 @@ export async function map_limit(items, limit, worker) {
|
||||
}
|
||||
|
||||
const runners = [];
|
||||
for (let i = 0; i < Math.min(n, list.length); i += 1) {
|
||||
for (let i = 0; i < list.length; i += 1) {
|
||||
runners.push(run_one());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user