Merge pull request 'MASTER_hotfix_deleteTrashFiles2' (!1130) from MASTER_hotfix_deleteTrashFiles2 into master
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
Reviewed-on: #1130
This commit is contained in:
commit
8607ab7ccc
|
@ -47,20 +47,22 @@ module.exports = Self => {
|
|||
for (let dms of dmsToDelete) {
|
||||
const pathHash = DmsContainer.getHash(dms.id);
|
||||
const dmsContainer = await DmsContainer.container(pathHash);
|
||||
const dstFile = path.join(dmsContainer.client.root, pathHash, dms.file);
|
||||
try {
|
||||
const dstFile = path.join(dmsContainer.client.root, pathHash, dms.file);
|
||||
await fs.unlink(dstFile);
|
||||
} catch (err) {
|
||||
continue;
|
||||
if (err.code != 'ENOENT')
|
||||
throw err;
|
||||
}
|
||||
|
||||
await dms.destroy(myOptions);
|
||||
|
||||
const dstFolder = path.join(dmsContainer.client.root, pathHash);
|
||||
try {
|
||||
await fs.rmdir(dstFolder);
|
||||
} catch (err) {
|
||||
continue;
|
||||
}
|
||||
|
||||
await dms.destroy(myOptions);
|
||||
}
|
||||
};
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue