Skip to content
This repository has been archived by the owner on Nov 28, 2022. It is now read-only.

Commit

Permalink
feat: fix delete log file error
Browse files Browse the repository at this point in the history
Signed-off-by: jingfu wang <[email protected]>
  • Loading branch information
GeekArthur committed Jun 8, 2020
1 parent 4208d92 commit 5579d5a
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/pfe/file-watcher/server/src/controllers/projectsController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1001,17 +1001,17 @@ export function deleteFolder(dir: string): Promise<void> {
if (err) {
return reject(err);
}
// Delete all files in the directory
Promise.all(files.map((file) => {
return deleteFile(dir, file);
})).then(() => {
rimraf(dir, (err) => {
if (err) {
return reject(err);
}
resolve();
});
}).catch(reject);
// Delete log folder and log files inside log folder
const option: rimraf.Options = {
maxBusyTries: 15,
};

rimraf(dir, option, (err) => {
if (err) {
return reject(err);
}
resolve();
});
});
});
});
Expand Down

0 comments on commit 5579d5a

Please sign in to comment.