diff --git a/pkg/services/sqlstore/transactions.go b/pkg/services/sqlstore/transactions.go index 3e7634dc196..eccd37f9a43 100644 --- a/pkg/services/sqlstore/transactions.go +++ b/pkg/services/sqlstore/transactions.go @@ -100,3 +100,7 @@ func inTransactionWithRetryCtx(ctx context.Context, callback dbTransactionFunc, func inTransaction(callback dbTransactionFunc) error { return inTransactionWithRetry(callback, 0) } + +func inTransactionCtx(ctx context.Context, callback dbTransactionFunc) error { + return inTransactionWithRetryCtx(ctx, callback, 0) +} diff --git a/pkg/services/sqlstore/user.go b/pkg/services/sqlstore/user.go index 4448e973e99..d32d51e0d0c 100644 --- a/pkg/services/sqlstore/user.go +++ b/pkg/services/sqlstore/user.go @@ -82,7 +82,7 @@ func getOrgIdForNewUser(cmd *m.CreateUserCommand, sess *DBSession) (int64, error } func CreateUser(ctx context.Context, cmd *m.CreateUserCommand) error { - return inTransactionWithRetryCtx(ctx, func(sess *DBSession) error { + return inTransactionCtx(ctx, func(sess *DBSession) error { orgId, err := getOrgIdForNewUser(cmd, sess) if err != nil { return err @@ -152,7 +152,7 @@ func CreateUser(ctx context.Context, cmd *m.CreateUserCommand) error { } return nil - }, 0) + }) } func GetUserById(query *m.GetUserByIdQuery) error {