fix(eventstore): cache instances (#6501)

* fix(eventstore): cache instances

* fix: consider succeeded once during instance ids query

* fix(eventstore): return correct instances

(cherry picked from commit 0f06e84f40)
This commit is contained in:
Silvan
2023-09-06 16:34:07 +02:00
committed by Livio Spring
parent 3b0be67627
commit f72560291e
2 changed files with 34 additions and 4 deletions

View File

@@ -279,7 +279,7 @@ func (h *ProjectionHandler) schedule(ctx context.Context) {
// This ensures that only instances with recent events on the handler are projected
query = query.CreationDateAfter(h.nowFunc().Add(-1 * h.handleActiveInstances))
}
ids, err := h.Eventstore.InstanceIDs(ctx, query.Builder())
ids, err := h.Eventstore.InstanceIDs(ctx, h.requeueAfter, !succeededOnce, query.Builder())
if err != nil {
logging.WithFields("projection", h.ProjectionName).WithError(err).Error("instance ids")
h.triggerProjection.Reset(h.requeueAfter)