From b67ccba76994caa4abbd383d0274ef921ba6f54e Mon Sep 17 00:00:00 2001 From: Zoltan Kochan Date: Tue, 4 Apr 2023 16:55:23 +0300 Subject: [PATCH] fix: retry copying on EBUSY error Recently a similar fix was merged for rename #127. But a similar issue happens on copy as well. ref https://github.com/pnpm/pnpm/issues/6201 --- graceful-fs.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/graceful-fs.js b/graceful-fs.js index 8d5b89e..d09757f 100644 --- a/graceful-fs.js +++ b/graceful-fs.js @@ -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')