mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-12 06:07:33 +00:00
fix(projections): pass context to statement execution method (#10328)
## Which problems are solved The execution of statements of projections did not have the context present. ## How the problems were solved Pass the context to the execute function ## Additional info This change is required to use the repositories of the relational tables in projections.
This commit is contained in:
@@ -646,7 +646,7 @@ func (h *Handler) executeStatements(ctx context.Context, tx *sql.Tx, statements
|
||||
for i, statement := range statements {
|
||||
select {
|
||||
case <-ctx.Done():
|
||||
break
|
||||
return lastProcessedIndex, ctx.Err()
|
||||
default:
|
||||
err := h.executeStatement(ctx, tx, statement)
|
||||
if err != nil {
|
||||
@@ -669,7 +669,7 @@ func (h *Handler) executeStatement(ctx context.Context, tx *sql.Tx, statement *S
|
||||
return err
|
||||
}
|
||||
|
||||
if err = statement.Execute(tx, h.projection.Name()); err != nil {
|
||||
if err = statement.Execute(ctx, tx, h.projection.Name()); err != nil {
|
||||
h.log().WithError(err).Error("statement execution failed")
|
||||
|
||||
_, rollbackErr := tx.ExecContext(ctx, "ROLLBACK TO SAVEPOINT exec_stmt")
|
||||
|
Reference in New Issue
Block a user