mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-11 19:07:30 +00:00
fix(storage): resolve deadlock occuring durring projection (#3671)
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
package eventstore
|
||||
|
||||
import (
|
||||
"database/sql"
|
||||
|
||||
"github.com/zitadel/zitadel/internal/errors"
|
||||
"github.com/zitadel/zitadel/internal/eventstore/repository"
|
||||
)
|
||||
@@ -14,6 +16,7 @@ type SearchQueryBuilder struct {
|
||||
resourceOwner string
|
||||
instanceID string
|
||||
queries []*SearchQuery
|
||||
tx *sql.Tx
|
||||
}
|
||||
|
||||
type SearchQuery struct {
|
||||
@@ -110,6 +113,12 @@ func (builder *SearchQueryBuilder) OrderAsc() *SearchQueryBuilder {
|
||||
return builder
|
||||
}
|
||||
|
||||
//SetTx ensures that the eventstore library uses the existing transaction
|
||||
func (builder *SearchQueryBuilder) SetTx(tx *sql.Tx) *SearchQueryBuilder {
|
||||
builder.tx = tx
|
||||
return builder
|
||||
}
|
||||
|
||||
//AddQuery creates a new sub query.
|
||||
//All fields in the sub query are AND-connected in the storage request.
|
||||
//Multiple sub queries are OR-connected in the storage request.
|
||||
@@ -240,6 +249,7 @@ func (builder *SearchQueryBuilder) build(instanceID string) (*repository.SearchQ
|
||||
Limit: builder.limit,
|
||||
Desc: builder.desc,
|
||||
Filters: filters,
|
||||
Tx: builder.tx,
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user