Skip to content

Commit a2772a7

Browse files
tmm1lukekarrys
andauthored
fix: use maxRetries on fs.rm calls (#3113)
* fix: remove more forcefully * add max retries to all fs.rm calls --------- Co-authored-by: Luke Karrys <[email protected]>
1 parent 80e9c79 commit a2772a7

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

Diff for: lib/build.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ async function build (gyp, argv) {
212212
await new Promise((resolve, reject) => proc.on('exit', async (code, signal) => {
213213
if (buildBinsDir) {
214214
// Clean up the build-time dependency symlinks:
215-
await fs.rm(buildBinsDir, { recursive: true })
215+
await fs.rm(buildBinsDir, { recursive: true, maxRetries: 3 })
216216
}
217217

218218
if (code !== 0) {

Diff for: lib/clean.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ async function clean (gyp, argv) {
88
const buildDir = 'build'
99

1010
log.verbose('clean', 'removing "%s" directory', buildDir)
11-
await fs.rm(buildDir, { recursive: true, force: true })
11+
await fs.rm(buildDir, { recursive: true, force: true, maxRetries: 3 })
1212
}
1313

1414
module.exports = clean

Diff for: lib/install.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,7 @@ async function install (gyp, argv) {
284284
if (tarExtractDir !== devDir) {
285285
try {
286286
// try to cleanup temp dir
287-
await fs.rm(tarExtractDir, { recursive: true })
287+
await fs.rm(tarExtractDir, { recursive: true, maxRetries: 3 })
288288
} catch {
289289
log.warn('failed to clean up temp tarball extract directory')
290290
}

Diff for: lib/remove.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ async function remove (gyp, argv) {
3636
throw err
3737
}
3838

39-
await fs.rm(versionPath, { recursive: true, force: true })
39+
await fs.rm(versionPath, { recursive: true, force: true, maxRetries: 3 })
4040
}
4141

4242
module.exports = remove

0 commit comments

Comments
 (0)