fix(projections): added check to make sure there cannot be 2 projections for the same table

This commit is contained in:
Iraq Jaber
2025-08-08 16:57:02 +01:00
parent d4222d6fd6
commit 57ae374793

View File

@@ -210,7 +210,14 @@ func Init(ctx context.Context) error {
}
func Start(ctx context.Context) {
projectionTableMap := make(map[string]bool, len(projections))
for _, projection := range projections {
table := projection.String()
if projectionTableMap[table] {
panic("projeciton for " + projection.String() + " already added")
}
projectionTableMap[table] = true
projection.Start(ctx)
}
}