Kill gorp (#19786)
* Kill gorp Gorp is dead. Long live Gorp. ```release-note NONE ```
Этот коммит содержится в:
коммит произвёл
GitHub
родитель
c3ec0a145b
Коммит
4da98cb51a
@@ -9,8 +9,6 @@ import (
|
||||
"strings"
|
||||
"unicode"
|
||||
|
||||
"github.com/mattermost/gorp"
|
||||
|
||||
"github.com/mattermost/mattermost-server/v6/shared/mlog"
|
||||
)
|
||||
|
||||
@@ -47,14 +45,6 @@ func MapStringsToQueryParams(list []string, paramPrefix string) (string, map[str
|
||||
return "(" + keys.String() + ")", params
|
||||
}
|
||||
|
||||
// finalizeTransaction ensures a transaction is closed after use, rolling back if not already committed.
|
||||
func finalizeTransaction(transaction *gorp.Transaction) {
|
||||
// Rollback returns sql.ErrTxDone if the transaction was already closed.
|
||||
if err := transaction.Rollback(); err != nil && err != sql.ErrTxDone {
|
||||
mlog.Error("Failed to rollback transaction", mlog.Err(err))
|
||||
}
|
||||
}
|
||||
|
||||
// finalizeTransactionX ensures a transaction is closed after use, rolling back if not already committed.
|
||||
func finalizeTransactionX(transaction *sqlxTxWrapper) {
|
||||
// Rollback returns sql.ErrTxDone if the transaction was already closed.
|
||||
|
||||
Ссылка в новой задаче
Block a user