Add retryDelay and a type cast to make it work.

This commit is contained in:
Chris Gavin 2022-02-28 19:37:17 +00:00
parent d63f798314
commit 938e0a0743
No known key found for this signature in database
GPG key ID: 07F950B80C27E4DA
3 changed files with 11 additions and 3 deletions

6
lib/analyze.js generated
View file

@ -244,7 +244,11 @@ 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, maxRetries: 5 });
await fs.promises.rmdir(outputDir, {
recursive: true,
maxRetries: 5,
retryDelay: 2000,
});
}
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,11 @@ 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, maxRetries: 5 });
await fs.promises.rmdir(outputDir, {
recursive: true,
maxRetries: 5,
retryDelay: 2000,
} as any);
} catch (error: any) {
if (error?.code !== "ENOENT") {
throw error;