mirror of
https://github.com/zitadel/zitadel.git
synced 2025-08-11 10:37:44 +00:00
fix(projections): added check to make sure there cannot be 2 projections for the same table
This commit is contained in:
@@ -210,7 +210,14 @@ func Init(ctx context.Context) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func Start(ctx context.Context) {
|
func Start(ctx context.Context) {
|
||||||
|
projectionTableMap := make(map[string]bool, len(projections))
|
||||||
for _, projection := range projections {
|
for _, projection := range projections {
|
||||||
|
table := projection.String()
|
||||||
|
if projectionTableMap[table] {
|
||||||
|
panic("projeciton for " + projection.String() + " already added")
|
||||||
|
}
|
||||||
|
projectionTableMap[table] = true
|
||||||
|
|
||||||
projection.Start(ctx)
|
projection.Start(ctx)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user