mirror of
https://github.com/mattermost/mattermost.git
synced 2025-02-25 18:55:24 -06:00
Add missing transaction rollbacks for SQL store (#9964)
* Add missing transaction rollbacks for SQL store * Add `defer transaction.Rollback()` in SQL stores. * abstract finalizeTransaction
This commit is contained in:
@@ -11,7 +11,6 @@ import (
|
||||
"strings"
|
||||
|
||||
"github.com/mattermost/gorp"
|
||||
|
||||
"github.com/mattermost/mattermost-server/model"
|
||||
"github.com/mattermost/mattermost-server/store"
|
||||
)
|
||||
@@ -94,6 +93,7 @@ func (s *SqlSupplier) RoleSave(ctx context.Context, role *model.Role, hints ...s
|
||||
result.Err = model.NewAppError("SqlRoleStore.RoleSave", "store.sql_role.save.open_transaction.app_error", nil, err.Error(), http.StatusInternalServerError)
|
||||
return result
|
||||
} else {
|
||||
defer finalizeTransaction(transaction)
|
||||
result = s.createRole(ctx, role, transaction, hints...)
|
||||
|
||||
if result.Err != nil {
|
||||
|
||||
Reference in New Issue
Block a user