From 89346c5e5f81ec00022c9af162a8f0a12b8927a2 Mon Sep 17 00:00:00 2001 From: Fergal Gribben Date: Thu, 27 Jun 2024 00:38:54 +0100 Subject: [PATCH] Recover filters in a single thread --- .../evmregistry/v21/logprovider/recoverer.go | 12 +++--------- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/logprovider/recoverer.go b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/logprovider/recoverer.go index bc4b260aa6d..94afd869f5d 100644 --- a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/logprovider/recoverer.go +++ b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/logprovider/recoverer.go @@ -350,17 +350,11 @@ func (r *logRecoverer) recover(ctx context.Context) error { r.lggr.Debugw("recovering logs", "filters", filters, "startBlock", start, "offsetBlock", offsetBlock, "latestBlock", latest) - var wg sync.WaitGroup for _, f := range filters { - wg.Add(1) - go func(f upkeepFilter) { - defer wg.Done() - if err := r.recoverFilter(ctx, f, start, offsetBlock); err != nil { - r.lggr.Debugw("error recovering filter", "err", err.Error()) - } - }(f) + if err := r.recoverFilter(ctx, f, start, offsetBlock); err != nil { + r.lggr.Debugw("error recovering filter", "err", err.Error()) + } } - wg.Wait() return nil }