Commit 4c5fe68e by bergquist

adds inTransactionCtx that calls inTransactionWithRetryCtx

parent 1181e967
...@@ -100,3 +100,7 @@ func inTransactionWithRetryCtx(ctx context.Context, callback dbTransactionFunc, ...@@ -100,3 +100,7 @@ func inTransactionWithRetryCtx(ctx context.Context, callback dbTransactionFunc,
func inTransaction(callback dbTransactionFunc) error { func inTransaction(callback dbTransactionFunc) error {
return inTransactionWithRetry(callback, 0) 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 ...@@ -82,7 +82,7 @@ func getOrgIdForNewUser(cmd *m.CreateUserCommand, sess *DBSession) (int64, error
} }
func CreateUser(ctx context.Context, cmd *m.CreateUserCommand) 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) orgId, err := getOrgIdForNewUser(cmd, sess)
if err != nil { if err != nil {
return err return err
...@@ -152,7 +152,7 @@ func CreateUser(ctx context.Context, cmd *m.CreateUserCommand) error { ...@@ -152,7 +152,7 @@ func CreateUser(ctx context.Context, cmd *m.CreateUserCommand) error {
} }
return nil return nil
}, 0) })
} }
func GetUserById(query *m.GetUserByIdQuery) error { func GetUserById(query *m.GetUserByIdQuery) error {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment