mirror of
https://github.com/grafana/grafana.git
synced 2025-01-08 23:23:45 -06:00
adds inTransactionCtx that calls inTransactionWithRetryCtx
This commit is contained in:
parent
1181e96799
commit
4c5fe68e7e
@ -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)
|
||||
}
|
||||
|
@ -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 {
|
||||
|
Loading…
Reference in New Issue
Block a user