mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-14 11:17:47 +00:00
fix(mirror): skip notification projections (#9878)
# Which Problems Are Solved During the mirror command execution we saw high wait times for notification projections. # How the Problems Are Solved As the events are skipped anyways because the notifications are sent out by the source Zitadel we skip the projections and just set the current state.
This commit is contained in:
@@ -248,7 +248,7 @@ func projections(
|
||||
}()
|
||||
|
||||
for i := 0; i < int(config.Projections.ConcurrentInstances); i++ {
|
||||
go execProjections(ctx, instances, failedInstances, &wg)
|
||||
go execProjections(ctx, es, instances, failedInstances, &wg)
|
||||
}
|
||||
|
||||
existingInstances := queryInstanceIDs(ctx, client)
|
||||
@@ -264,7 +264,7 @@ func projections(
|
||||
logging.WithFields("took", time.Since(start)).Info("projections executed")
|
||||
}
|
||||
|
||||
func execProjections(ctx context.Context, instances <-chan string, failedInstances chan<- string, wg *sync.WaitGroup) {
|
||||
func execProjections(ctx context.Context, es *eventstore.Eventstore, instances <-chan string, failedInstances chan<- string, wg *sync.WaitGroup) {
|
||||
for instance := range instances {
|
||||
logging.WithFields("instance", instance).Info("starting projections")
|
||||
ctx = internal_authz.WithInstanceID(ctx, instance)
|
||||
@@ -290,7 +290,7 @@ func execProjections(ctx context.Context, instances <-chan string, failedInstanc
|
||||
continue
|
||||
}
|
||||
|
||||
err = notification.ProjectInstance(ctx)
|
||||
err = notification.SetCurrentState(ctx, es)
|
||||
if err != nil {
|
||||
logging.WithFields("instance", instance).OnError(err).Info("trigger notification failed")
|
||||
failedInstances <- instance
|
||||
|
Reference in New Issue
Block a user