fix: mapping (#2522)

* fix: mapping

* add logs

Co-authored-by: adlerhurst <silvan.reusser@gmail.com>
This commit is contained in:
Fabi 2021-10-18 10:41:39 +02:00 committed by GitHub
parent 1de1b14282
commit 040b53305c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View File

@ -120,6 +120,7 @@ func (h *ProjectionHandler) Process(
return return
case event := <-h.Handler.EventQueue: case event := <-h.Handler.EventQueue:
if err := h.processEvent(ctx, event, reduce); err != nil { if err := h.processEvent(ctx, event, reduce); err != nil {
logging.LogWithFields("HANDL-TUk5J", "projection", h.ProjectionName).WithError(err).Warn("process failed")
continue continue
} }
h.triggerShouldPush(0) h.triggerShouldPush(0)
@ -137,6 +138,7 @@ func (h *ProjectionHandler) Process(
return return
case event := <-h.Handler.EventQueue: case event := <-h.Handler.EventQueue:
if err := h.processEvent(ctx, event, reduce); err != nil { if err := h.processEvent(ctx, event, reduce); err != nil {
logging.LogWithFields("HANDL-horKq", "projection", h.ProjectionName).WithError(err).Warn("process failed")
continue continue
} }
h.triggerShouldPush(0) h.triggerShouldPush(0)

View File

@ -122,7 +122,7 @@ func (p *ProjectGrantProjection) reduceProjectGrantChanged(event eventstore.Even
} }
func (p *ProjectGrantProjection) reduceProjectGrantCascadeChanged(event eventstore.EventReader) (*handler.Statement, error) { func (p *ProjectGrantProjection) reduceProjectGrantCascadeChanged(event eventstore.EventReader) (*handler.Statement, error) {
e, ok := event.(*project.GrantChangedEvent) e, ok := event.(*project.GrantCascadeChangedEvent)
if !ok { if !ok {
logging.LogWithFields("HANDL-K0fwR", "seq", event.Sequence(), "expectedType", project.GrantCascadeChangedType).Error("was not an event") logging.LogWithFields("HANDL-K0fwR", "seq", event.Sequence(), "expectedType", project.GrantCascadeChangedType).Error("was not an event")
return nil, errors.ThrowInvalidArgument(nil, "HANDL-ll9Ts", "reduce.wrong.event.type") return nil, errors.ThrowInvalidArgument(nil, "HANDL-ll9Ts", "reduce.wrong.event.type")