fix: trans error rollback

This commit is contained in:
a631807682 2024-03-06 17:24:00 +08:00
parent 3e2c4fc446
commit 4c474104de
No known key found for this signature in database
GPG Key ID: 137D1D75522168AB

View File

@ -650,7 +650,8 @@ func (db *DB) Transaction(fc func(tx *DB) error, opts ...*sql.TxOptions) (err er
if err = fc(tx); err == nil { if err = fc(tx); err == nil {
panicked = false panicked = false
return tx.Commit().Error err = tx.Commit().Error
return
} }
} }