Merge pull request '4091-dms_clean_fix' (#1059) from 4091-dms_clean_fix into dev
gitea/salix/pipeline/head This commit looks good Details

Reviewed-on: #1059
Reviewed-by: Joan Sanchez <joan@verdnatura.es>
This commit is contained in:
Joan Sanchez 2022-09-21 12:23:41 +00:00
commit 423cf5bdad
1 changed files with 5 additions and 1 deletions

View File

@ -53,8 +53,12 @@ module.exports = Self => {
const pathHash = DmsContainer.getHash(dms.id); const pathHash = DmsContainer.getHash(dms.id);
const dmsContainer = await DmsContainer.container(pathHash); const dmsContainer = await DmsContainer.container(pathHash);
const dstFile = path.join(dmsContainer.client.root, pathHash, dms.file); const dstFile = path.join(dmsContainer.client.root, pathHash, dms.file);
try {
await fs.unlink(dstFile);
} catch (err) {
continue;
}
const dstFolder = path.join(dmsContainer.client.root, pathHash); const dstFolder = path.join(dmsContainer.client.root, pathHash);
await fs.unlink(dstFile);
try { try {
await fs.rmdir(dstFolder); await fs.rmdir(dstFolder);
await dms.destroy(myOptions); await dms.destroy(myOptions);