Skip to content

Commit 3b0bcc0

Browse files
authored
Fix: bring back the aggressive concurrency protection (#4573)
**Summary** Follow up to #4486 which reverted the while loop that waits on potential multiple copies of the same file. This seems to have some random breakages and needs more investigation for optimizing. **Test plan** N/A
1 parent 391eade commit 3b0bcc0

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/util/fs.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -603,10 +603,10 @@ export async function copyBulk(
603603

604604
await promise.queue(
605605
fileActions,
606-
(data: CopyFileAction): Promise<void> => {
607-
const writePromise = currentlyWriting.get(data.dest);
608-
if (writePromise) {
609-
return writePromise;
606+
async (data: CopyFileAction): Promise<void> => {
607+
let writePromise;
608+
while ((writePromise = currentlyWriting.get(data.dest))) {
609+
await writePromise;
610610
}
611611

612612
reporter.verbose(reporter.lang('verboseFileCopy', data.src, data.dest));

0 commit comments

Comments
 (0)