fix(eventstore): prevent allocation of filtered events (#6749)

* fix(eventstore): prevent allocation of filtered events

Directly reduce each event obtained from a sql.Rows scan,
so that we do not have to allocate all events in a slice.

* reinstate the mutex as RWMutex

* scan data directly

* add todos

* fix(writemodels): add reduce of parent

* test: remove comment

* update comments

---------

Co-authored-by: adlerhurst <silvan.reusser@gmail.com>
This commit is contained in:
Tim Möhlmann
2023-10-19 18:21:31 +03:00
committed by GitHub
parent 459761d99a
commit ab79855cf0
16 changed files with 150 additions and 93 deletions

View File

@@ -55,7 +55,7 @@ func (wm *InstanceDomainWriteModel) Reduce() error {
wm.State = domain.InstanceDomainStateRemoved
}
}
return nil
return wm.WriteModel.Reduce()
}
func (wm *InstanceDomainWriteModel) Query() *eventstore.SearchQueryBuilder {