Merge pull request '4091-dms_clean_fix' (#1059) from 4091-dms_clean_fix into dev
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
Reviewed-on: #1059 Reviewed-by: Joan Sanchez <joan@verdnatura.es>
This commit is contained in:
commit
423cf5bdad
|
@ -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);
|
||||||
|
|
Loading…
Reference in New Issue