mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-12 01:27:32 +00:00
fix: scheduling (#3978)
* fix: improve scheduling * build pre-release * fix: locker * fix: user handler and print stack in case of panic in reducer * chore: remove sentry * fix: improve handler projection and implement tests * more tests * fix: race condition in tests * Update internal/eventstore/repository/sql/query.go Co-authored-by: Silvan <silvan.reusser@gmail.com> * fix: implemented suggested changes * fix: lock statement Co-authored-by: Silvan <silvan.reusser@gmail.com>
This commit is contained in:
@@ -8,8 +8,10 @@ import (
|
||||
"github.com/zitadel/zitadel/internal/auth/repository/eventsourcing/view"
|
||||
sd "github.com/zitadel/zitadel/internal/config/systemdefaults"
|
||||
v1 "github.com/zitadel/zitadel/internal/eventstore/v1"
|
||||
"github.com/zitadel/zitadel/internal/eventstore/v1/models"
|
||||
"github.com/zitadel/zitadel/internal/eventstore/v1/query"
|
||||
query2 "github.com/zitadel/zitadel/internal/query"
|
||||
"github.com/zitadel/zitadel/internal/view/repository"
|
||||
)
|
||||
|
||||
type Configs map[string]*Config
|
||||
@@ -75,3 +77,21 @@ func (h *handler) QueryLimit() uint64 {
|
||||
func withInstanceID(ctx context.Context, instanceID string) context.Context {
|
||||
return authz.WithInstanceID(ctx, instanceID)
|
||||
}
|
||||
|
||||
func newSearchQuery(sequences []*repository.CurrentSequence, aggregateTypes []models.AggregateType, instanceIDs []string) *models.SearchQuery {
|
||||
searchQuery := models.NewSearchQuery()
|
||||
for _, sequence := range sequences {
|
||||
var seq uint64
|
||||
for _, instanceID := range instanceIDs {
|
||||
if sequence.InstanceID == instanceID {
|
||||
seq = sequence.CurrentSequence
|
||||
break
|
||||
}
|
||||
}
|
||||
searchQuery.AddQuery().
|
||||
AggregateTypeFilter(aggregateTypes...).
|
||||
LatestSequenceFilter(seq).
|
||||
InstanceIDFilter(sequence.InstanceID)
|
||||
}
|
||||
return searchQuery
|
||||
}
|
||||
|
Reference in New Issue
Block a user