updaloadFile transaction commit conditional
gitea/salix/pipeline/head This commit looks good Details

This commit is contained in:
Carlos Jimenez Ruiz 2021-03-30 10:17:16 +02:00
parent 8797444553
commit e025368af1
1 changed files with 4 additions and 4 deletions

View File

@ -78,12 +78,12 @@ module.exports = Self => {
});
const resolvedPromises = await Promise.all(promises);
await tx.commit();
if (tx) await tx.commit();
return resolvedPromises;
} catch (err) {
await tx.rollback();
throw err;
} catch (e) {
if (tx) await tx.rollback();
throw e;
}
};
};