Skip to content

Commit

Permalink
Use map order and default selector
Browse files Browse the repository at this point in the history
  • Loading branch information
ferglor committed Apr 28, 2024
1 parent a003bfb commit 169d5a7
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -305,14 +305,14 @@ func (p *logEventProvider) getLogsFromBuffer(latestBlock int64) []ocr2keepers.Up
p.iterations = int(math.Ceil(float64(p.bufferV1.NumOfUpkeeps()*logLimitLow) / float64(maxResults)))
}

upkeepSelectorFn := func(id *big.Int) bool {
return id.Int64()%int64(p.iterations) == int64(p.currentIteration)
}
//upkeepSelectorFn := func(id *big.Int) bool {
// return id.Int64()%int64(p.iterations) == int64(p.currentIteration)
//}

for len(payloads) < maxResults && start <= latestBlock {
startWindow, end := getBlockWindow(start, blockRate)

logs, remaining := p.bufferV1.Dequeue(startWindow, end, logLimitLow, maxResults-len(payloads), upkeepSelectorFn)
logs, remaining := p.bufferV1.Dequeue(startWindow, end, logLimitLow, maxResults-len(payloads), DefaultUpkeepSelector)
if len(logs) > 0 {
p.lggr.Debugw("Dequeued logs", "start", start, "latestBlock", latestBlock, "logs", len(logs))
}
Expand Down

0 comments on commit 169d5a7

Please sign in to comment.