fix: jump to next iteration if file not found
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
This commit is contained in:
parent
284524e3fa
commit
04676d5d98
|
@ -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