Skip to content

Commit ce893fc

Browse files
authored
fix(git-node): batch requests in wpt (#813)
Fixes: #810
1 parent 5cef56f commit ce893fc

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

lib/wpt/index.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -79,9 +79,13 @@ 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+
// See https://github.com/nodejs/node-core-utils/issues/810
83+
for (let i = 0; i < assets.length; i += 10) {
84+
const chunk = assets.slice(i, i + 10);
85+
await Promise.all(chunk.map(
86+
(asset) => this.pullTextFile(fixtures, asset.name)
87+
));
88+
}
8589
this.cli.stopSpinner(`Downloaded ${assets.length} assets.`);
8690

8791
return assets;

0 commit comments

Comments
 (0)