Transaction error
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
This commit is contained in:
parent
a4549a9f4e
commit
d06492d367
|
@ -17,7 +17,6 @@ module.exports = Self => {
|
|||
});
|
||||
|
||||
Self.deleteTrashFiles = async options => {
|
||||
const tx = await Self.beginTransaction({});
|
||||
const myOptions = {};
|
||||
|
||||
if (typeof options == 'object')
|
||||
|
@ -27,6 +26,7 @@ module.exports = Self => {
|
|||
myOptions.transaction = tx;
|
||||
|
||||
try {
|
||||
const tx = await Self.beginTransaction({});
|
||||
if (process.env.NODE_ENV == 'test')
|
||||
throw new UserError(`Action not allowed on the test environment`);
|
||||
|
||||
|
@ -61,10 +61,9 @@ module.exports = Self => {
|
|||
const dstFolder = path.join(dmsContainer.client.root, pathHash);
|
||||
try {
|
||||
await fs.rmdir(dstFolder);
|
||||
} catch (err) {}
|
||||
|
||||
await dms.destroy(myOptions);
|
||||
} catch (err) {
|
||||
await dms.destroy(myOptions);
|
||||
}
|
||||
}
|
||||
if (tx) await tx.commit();
|
||||
} catch (e) {
|
||||
|
|
Loading…
Reference in New Issue