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

Commit 5fcf76d7 by Aaron Nielsen

Don't rollback twice on connection error

1 parent a2366463
Showing with 3 additions and 0 deletions
......@@ -1239,6 +1239,9 @@ Sequelize.prototype.transaction = function(options, autoCallback) {
// If an error occured while commiting a transaction do not try to rollback the transaction
if (transaction.finished === 'commit') {
reject(err);
} else if (transaction.finished === 'rollback'){
// Already in rollback state. Reject with the original error.
reject(err);
} else {
transaction.rollback().finally(function () {
reject(err);
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!