Skip to content

Commit

Permalink
Merge pull request #4401 from sanjaiyan-dev/sanjaiyan-async-concurrent
Browse files Browse the repository at this point in the history
[rush-lib] Enhancing Performance with Concurrent Execution using `Promise.all` ✈
  • Loading branch information
D4N14L authored Oct 27, 2023
2 parents 7015675 + aef5a50 commit 1f101e6
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"changes": [
{
"packageName": "@microsoft/rush",
"comment": "performance improvements by running asynchronous code concurrently using Promise.all",
"type": "none"
}
],
"packageName": "@microsoft/rush"
}
6 changes: 3 additions & 3 deletions libraries/rush-lib/scripts/copyEmptyModules.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict';

const { FileSystem } = require('@rushstack/node-core-library');
const { FileSystem, Async } = require('@rushstack/node-core-library');

const JS_FILE_EXTENSION = '.js';
const DTS_FILE_EXTENSION = '.d.ts';
Expand Down Expand Up @@ -50,7 +50,7 @@ module.exports = {
const folderItems = await FileSystem.readFolderItemsAsync(
relativeFolderPath ? `${jsInFolderPath}/${relativeFolderPath}` : jsInFolderPath
);
for (const folderItem of folderItems) {
await Async.forEachAsync(folderItems, async (folderItem) => {
const itemName = folderItem.name;
const relativeItemPath = relativeFolderPath ? `${relativeFolderPath}/${itemName}` : itemName;

Expand All @@ -76,7 +76,7 @@ module.exports = {
await FileSystem.writeFileAsync(outDtsPath, buffer, { ensureFolderExists: true });
}
}
}
});
}

await searchAsync(undefined);
Expand Down

0 comments on commit 1f101e6

Please sign in to comment.