From a6fb7024998828e912fcedadb74ba906d1c18e39 Mon Sep 17 00:00:00 2001 From: Fergal Gribben Date: Sat, 15 Jun 2024 12:16:34 +0100 Subject: [PATCH] Set new queue IDs --- .../ocr2keeper/evmregistry/v21/logprovider/buffer_v1.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/logprovider/buffer_v1.go b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/logprovider/buffer_v1.go index 2e8b207b805..323ff16f2ad 100644 --- a/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/logprovider/buffer_v1.go +++ b/core/services/ocr2/plugins/ocr2keeper/evmregistry/v21/logprovider/buffer_v1.go @@ -239,16 +239,20 @@ func (b *logBuffer) SyncFilters(filterStore UpkeepFilterStore) error { b.lock.Lock() defer b.lock.Unlock() - for i, upkeepID := range b.queueIDs { + var newQueueIDs []string + for _, upkeepID := range b.queueIDs { uid := new(big.Int) _, ok := uid.SetString(upkeepID, 10) if ok && !filterStore.Has(uid) { // remove upkeep that is not in the filter store delete(b.queues, upkeepID) - b.queueIDs = append(b.queueIDs[:i], b.queueIDs[i+1:]...) + } else { + newQueueIDs = append(newQueueIDs, upkeepID) } } + b.queueIDs = newQueueIDs + return nil }