We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 465bcda commit d709eb1Copy full SHA for d709eb1
packages/runtime/src/helpers/files.ts
@@ -480,8 +480,13 @@ export const movePublicFiles = async ({
480
}
481
482
export const removeMetadataFiles = async (publish: string) => {
483
- for (const HIDDEN_PATH of HIDDEN_PATHS) {
+ // Limit concurrent file moves to number of cpus or 2 if there is only 1
484
+ const limit = pLimit(Math.max(2, cpus().length))
485
+
486
+ const removePromises = HIDDEN_PATHS.map((HIDDEN_PATH) => {
487
const pathToDelete = join(publish, HIDDEN_PATH)
- await remove(pathToDelete)
- }
488
+ return limit(() => remove(pathToDelete))
489
+ })
490
491
+ await Promise.all(removePromises)
492
0 commit comments