fix(closure): removed transaction
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Joan Sanchez 2022-02-18 08:49:31 +01:00
parent 46488aa600
commit c260917e20
1 changed files with 0 additions and 4 deletions

View File

@ -12,8 +12,6 @@ module.exports = {
const failedtickets = []; const failedtickets = [];
for (const ticket of tickets) { for (const ticket of tickets) {
try { try {
await db.rawSql('START TRANSACTION');
await db.rawSql(`CALL vn.ticket_closeByTicket(?)`, [ticket.id]); await db.rawSql(`CALL vn.ticket_closeByTicket(?)`, [ticket.id]);
const invoiceOut = await db.findOne(` const invoiceOut = await db.findOne(`
@ -91,9 +89,7 @@ module.exports = {
const email = new Email('delivery-note-link', args); const email = new Email('delivery-note-link', args);
await email.send(); await email.send();
} }
await db.rawSql('COMMIT');
} catch (error) { } catch (error) {
await db.rawSql('ROLLBACK');
// Domain not found // Domain not found
if (error.responseCode == 450) if (error.responseCode == 450)
return invalidEmail(ticket); return invalidEmail(ticket);