Skip to content

Commit

Permalink
Fix: bring back the aggressive concurrency protection (#4573)
Browse files Browse the repository at this point in the history
**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
  • Loading branch information
BYK authored Sep 28, 2017
1 parent 391eade commit 3b0bcc0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/util/fs.js
Original file line number Diff line number Diff line change
Expand Up @@ -603,10 +603,10 @@ export async function copyBulk(

await promise.queue(
fileActions,
(data: CopyFileAction): Promise<void> => {
const writePromise = currentlyWriting.get(data.dest);
if (writePromise) {
return writePromise;
async (data: CopyFileAction): Promise<void> => {
let writePromise;
while ((writePromise = currentlyWriting.get(data.dest))) {
await writePromise;
}

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

0 comments on commit 3b0bcc0

Please sign in to comment.