Skip to content

Commit

Permalink
Recalculate total iterations on new window
Browse files Browse the repository at this point in the history
  • Loading branch information
ferglor committed Apr 22, 2024
1 parent 7c48ef4 commit 8214bc8
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,13 @@ func (p *logEventProvider) getLogsFromBuffer(latestBlock int64) []ocr2keepers.Up
}
start += int64(blockRate)
p.currentIteration = 0
p.iterations = int(math.Ceil(float64(p.bufferV1.NumOfUpkeeps()*logLimitLow) / float64(maxResults)))
if p.iterations == 0 {
p.iterations = 1
}
p.lggr.Debugw("calculated iterations", "iterations", p.iterations, "upkeeps", p.bufferV1.NumOfUpkeeps(), "logLimitLow", logLimitLow, "maxResults", maxResults)
currentIteration = p.currentIteration % p.iterations

}

if p.currentIteration < p.iterations {
Expand Down

0 comments on commit 8214bc8

Please sign in to comment.