mirror of
https://github.com/zitadel/zitadel.git
synced 2024-12-15 12:27:59 +00:00
7967e6f98b
# Which Problems Are Solved Improve the performance of human imports by optimizing the query that finds domains claimed by other organizations. # How the Problems Are Solved Use the fields search table introduced in https://github.com/zitadel/zitadel/pull/8191 by storing each organization domain as Object ID and the verified status as field value. # Additional Changes - Feature flag for this optimization # Additional Context - Performance improvements for import are evaluated and acted upon internally at the moment --------- Co-authored-by: adlerhurst <silvan.reusser@gmail.com>
39 lines
997 B
Go
39 lines
997 B
Go
package projection
|
|
|
|
import (
|
|
"github.com/zitadel/zitadel/internal/eventstore"
|
|
"github.com/zitadel/zitadel/internal/eventstore/handler/v2"
|
|
"github.com/zitadel/zitadel/internal/repository/org"
|
|
"github.com/zitadel/zitadel/internal/repository/project"
|
|
)
|
|
|
|
const (
|
|
fieldsProjectGrant = "project_grant_fields"
|
|
fieldsOrgDomainVerified = "org_domain_verified_fields"
|
|
)
|
|
|
|
func newFillProjectGrantFields(config handler.Config) *handler.FieldHandler {
|
|
return handler.NewFieldHandler(
|
|
&config,
|
|
fieldsProjectGrant,
|
|
map[eventstore.AggregateType][]eventstore.EventType{
|
|
org.AggregateType: nil,
|
|
project.AggregateType: nil,
|
|
},
|
|
)
|
|
}
|
|
|
|
func newFillOrgDomainVerifiedFields(config handler.Config) *handler.FieldHandler {
|
|
return handler.NewFieldHandler(
|
|
&config,
|
|
fieldsOrgDomainVerified,
|
|
map[eventstore.AggregateType][]eventstore.EventType{
|
|
org.AggregateType: {
|
|
org.OrgDomainAddedEventType,
|
|
org.OrgDomainVerifiedEventType,
|
|
org.OrgDomainRemovedEventType,
|
|
},
|
|
},
|
|
)
|
|
}
|