Skip to content

Commit

Permalink
fix: retry copying on EBUSY error
Browse files Browse the repository at this point in the history
Recently a similar fix was merged for rename isaacs#127.
But a similar issue happens on copy as well.

ref pnpm/pnpm#6201
  • Loading branch information
zkochan committed Apr 4, 2023
1 parent 2343799 commit b67ccba
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion graceful-fs.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ function patch (fs) {

function go$copyFile (src, dest, flags, cb, startTime) {
return fs$copyFile(src, dest, flags, function (err) {
if (err && (err.code === 'EMFILE' || err.code === 'ENFILE'))
if (err && (err.code === 'EMFILE' || err.code === 'ENFILE' || err.code === 'EBUSY'))
enqueue([go$copyFile, [src, dest, flags, cb], err, startTime || Date.now(), Date.now()])
else {
if (typeof cb === 'function')
Expand Down

0 comments on commit b67ccba

Please sign in to comment.