Skip to content

Commit 9bf2d72

Browse files
authored
fix: error handling in reconcile loop (#3753)
1 parent 73b16ce commit 9bf2d72

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

openmeter/notification/eventhandler/reconcile.go

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,8 +85,6 @@ func (h *Handler) Reconcile(ctx context.Context) error {
8585

8686
span.AddEvent("lock acquired")
8787

88-
var errs []error
89-
9088
page := pagination.Page{
9189
PageSize: 50,
9290
PageNumber: 1,
@@ -113,9 +111,10 @@ func (h *Handler) Reconcile(ctx context.Context) error {
113111
for _, event := range out.Items {
114112
// TODO: run reconciliation in parallel (goroutines)
115113
if err = h.reconcileEvent(ctx, &event); err != nil {
116-
errs = append(errs,
117-
fmt.Errorf("failed to reconcile notification event [namespace=%s notification.event.id=%s]: %w",
118-
event.Namespace, event.ID, err),
114+
h.logger.ErrorContext(ctx, "failed to reconcile notification event",
115+
"namespace", event.Namespace,
116+
"notification.event.id", event.ID,
117+
"error", err.Error(),
119118
)
120119
}
121120
}
@@ -127,7 +126,7 @@ func (h *Handler) Reconcile(ctx context.Context) error {
127126
page.PageNumber++
128127
}
129128

130-
return errors.Join(errs...)
129+
return nil
131130
})
132131
}
133132

0 commit comments

Comments
 (0)