mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-14 07:27:39 +00:00
Revert "fix(mirror): include fields in mirror projections (#9884)"
This reverts commit 5e66851c69
.
This commit is contained in:
@@ -285,13 +285,6 @@ func execProjections(ctx context.Context, instances <-chan string, failedInstanc
|
|||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
err = projection.ProjectInstanceFields(ctx)
|
|
||||||
if err != nil {
|
|
||||||
logging.WithFields("instance", instance).WithError(err).Info("trigger fields failed")
|
|
||||||
failedInstances <- instance
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
err = auth_handler.ProjectInstance(ctx)
|
err = auth_handler.ProjectInstance(ctx)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
logging.WithFields("instance", instance).OnError(err).Info("trigger auth handler failed")
|
logging.WithFields("instance", instance).OnError(err).Info("trigger auth handler failed")
|
||||||
|
@@ -101,7 +101,6 @@ type projection interface {
|
|||||||
|
|
||||||
var (
|
var (
|
||||||
projections []projection
|
projections []projection
|
||||||
fields []*handler.FieldHandler
|
|
||||||
)
|
)
|
||||||
|
|
||||||
func Create(ctx context.Context, sqlClient *database.DB, es handler.EventStore, config Config, keyEncryptionAlgorithm crypto.EncryptionAlgorithm, certEncryptionAlgorithm crypto.EncryptionAlgorithm, systemUsers map[string]*internal_authz.SystemAPIUser) error {
|
func Create(ctx context.Context, sqlClient *database.DB, es handler.EventStore, config Config, keyEncryptionAlgorithm crypto.EncryptionAlgorithm, certEncryptionAlgorithm crypto.EncryptionAlgorithm, systemUsers map[string]*internal_authz.SystemAPIUser) error {
|
||||||
@@ -183,7 +182,6 @@ func Create(ctx context.Context, sqlClient *database.DB, es handler.EventStore,
|
|||||||
MembershipFields = newFillMembershipFields(applyCustomConfig(projectionConfig, config.Customizations[fieldsMemberships]))
|
MembershipFields = newFillMembershipFields(applyCustomConfig(projectionConfig, config.Customizations[fieldsMemberships]))
|
||||||
|
|
||||||
newProjectionsList()
|
newProjectionsList()
|
||||||
newFieldsList()
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -217,18 +215,6 @@ func ProjectInstance(ctx context.Context) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func ProjectInstanceFields(ctx context.Context) error {
|
|
||||||
for i, fieldProjection := range fields {
|
|
||||||
logging.WithFields("name", fieldProjection.ProjectionName(), "instance", internal_authz.GetInstance(ctx).InstanceID(), "index", fmt.Sprintf("%d/%d", i, len(fields))).Info("starting fields projection")
|
|
||||||
err := fieldProjection.Trigger(ctx)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
logging.WithFields("name", fieldProjection.ProjectionName(), "instance", internal_authz.GetInstance(ctx).InstanceID()).Info("fields projection done")
|
|
||||||
}
|
|
||||||
return nil
|
|
||||||
}
|
|
||||||
|
|
||||||
func ApplyCustomConfig(customConfig CustomConfig) handler.Config {
|
func ApplyCustomConfig(customConfig CustomConfig) handler.Config {
|
||||||
return applyCustomConfig(projectionConfig, customConfig)
|
return applyCustomConfig(projectionConfig, customConfig)
|
||||||
}
|
}
|
||||||
@@ -253,17 +239,6 @@ func applyCustomConfig(config handler.Config, customConfig CustomConfig) handler
|
|||||||
return config
|
return config
|
||||||
}
|
}
|
||||||
|
|
||||||
// we know this is ugly, but we need to have a singleton slice of all projections
|
|
||||||
// and are only able to initialize it after all projections are created
|
|
||||||
// as setup and start currently create them individually, we make sure we get the right one
|
|
||||||
// will be refactored when changing to new id based projections
|
|
||||||
func newFieldsList() {
|
|
||||||
fields = []*handler.FieldHandler{
|
|
||||||
ProjectGrantFields,
|
|
||||||
OrgDomainVerifiedFields,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// we know this is ugly, but we need to have a singleton slice of all projections
|
// we know this is ugly, but we need to have a singleton slice of all projections
|
||||||
// and are only able to initialize it after all projections are created
|
// and are only able to initialize it after all projections are created
|
||||||
// as setup and start currently create them individually, we make sure we get the right one
|
// as setup and start currently create them individually, we make sure we get the right one
|
||||||
|
Reference in New Issue
Block a user