Skip to content

Commit

Permalink
Attempt to fix streams lookup race condition (smartcontractkit#11284)
Browse files Browse the repository at this point in the history
  • Loading branch information
ferglor authored Nov 14, 2023
1 parent 7be17c9 commit 9471f2e
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions core/services/ocr2/plugins/ocr2keeper/evm21/streams_lookup.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,11 +151,13 @@ func (r *EvmRegistry) streamsLookup(ctx context.Context, checkResults []ocr2keep
var wg sync.WaitGroup

for i, lookup := range lookups {
i := i
wg.Add(1)
r.threadCtrl.Go(func(ctx context.Context) {
r.doLookup(ctx, &wg, lookup, i, checkResults, lggr)
})
func(i int, lookup *StreamsLookup) {
r.threadCtrl.Go(func(ctx context.Context) {
r.doLookup(ctx, &wg, lookup, i, checkResults, lggr)
})
}(i, lookup)

}

wg.Wait()
Expand Down

0 comments on commit 9471f2e

Please sign in to comment.