Skip to content

Commit

Permalink
fix: batch requests in wpt
Browse files Browse the repository at this point in the history
  • Loading branch information
KhafraDev committed May 31, 2024
1 parent 8673073 commit d6157d3
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/wpt/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,12 @@ export class WPTUpdater {
await removeDirectory(this.fixtures(this.path));

this.cli.startSpinner('Pulling assets...');
await Promise.all(assets.map(
(asset) => this.pullTextFile(fixtures, asset.name)
));
for (let i = 0; i < assets.length; i += 10) {
const chunk = assets.slice(i, i + 10);
await Promise.all(chunk.map(
(asset) => this.pullTextFile(fixtures, asset.name)
));
}
this.cli.stopSpinner(`Downloaded ${assets.length} assets.`);

return assets;
Expand Down

0 comments on commit d6157d3

Please sign in to comment.