Skip to content

Commit cbbc80d

Browse files
committed
fix: batch requests in wpt
1 parent 8673073 commit cbbc80d

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

lib/wpt/index.js

+6-3
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,12 @@ export class WPTUpdater {
7979
await removeDirectory(this.fixtures(this.path));
8080

8181
this.cli.startSpinner('Pulling assets...');
82-
await Promise.all(assets.map(
83-
(asset) => this.pullTextFile(fixtures, asset.name)
84-
));
82+
for (let i = 0; i < assets.length; i += 10) {
83+
const chunk = assets.slice(i, i + 10)
84+
await Promise.all(chunk.map(
85+
(asset) => this.pullTextFile(fixtures, asset.name)
86+
));
87+
}
8588
this.cli.stopSpinner(`Downloaded ${assets.length} assets.`);
8689

8790
return assets;

0 commit comments

Comments
 (0)