不要怂,就是干,撸起袖子干!

Commit 8421ee8d by Mick Hansen

Merge pull request #5043 from spitimage/fix4850

Don't rollback twice on connection error. Fixes issue #4850.
2 parents c801a8a5 e6e0a303
Showing with 2 additions and 2 deletions
......@@ -1236,8 +1236,8 @@ Sequelize.prototype.transaction = function(options, autoCallback) {
});
});
}).catch(function(err) {
// If an error occured while commiting a transaction do not try to rollback the transaction
if (transaction.finished === 'commit') {
// If the transaction has already finished (commit, rollback, etc), reject with the original error
if (transaction.finished) {
reject(err);
} else {
transaction.rollback().finally(function () {
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!