Retry directory deletion to avoid Windows file locking issues.

Co-authored-by: Andrew Eisenberg <aeisenberg@github.com>
This commit is contained in:
Chris Gavin 2022-02-28 18:34:27 +00:00
parent 86940df49f
commit d63f798314
No known key found for this signature in database
GPG key ID: 07F950B80C27E4DA
3 changed files with 3 additions and 3 deletions

2
lib/analyze.js generated
View file

@ -244,7 +244,7 @@ async function runFinalize(outputDir, threadsFlag, memoryFlag, config, logger) {
}
// After switching to Node16, this entire block can be replaced with `await fs.promises.rm(outputDir, { recursive: true, force: true });`.
try {
await fs.promises.rmdir(outputDir, { recursive: true });
await fs.promises.rmdir(outputDir, { recursive: true, maxRetries: 5 });
}
catch (error) {
if ((error === null || error === void 0 ? void 0 : error.code) !== "ENOENT") {

File diff suppressed because one or more lines are too long

View file

@ -425,7 +425,7 @@ export async function runFinalize(
// After switching to Node16, this entire block can be replaced with `await fs.promises.rm(outputDir, { recursive: true, force: true });`.
try {
await fs.promises.rmdir(outputDir, { recursive: true });
await fs.promises.rmdir(outputDir, { recursive: true, maxRetries: 5 });
} catch (error: any) {
if (error?.code !== "ENOENT") {
throw error;