Skip to content

Commit

Permalink
Clean up based on start window
Browse files Browse the repository at this point in the history
  • Loading branch information
ferglor committed Jul 4, 2024
1 parent 273f4df commit f9a2037
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ type LogBuffer interface {
// given upkeep was exceeded. Returns the number of logs that were added and number of logs that were dropped.
Enqueue(id *big.Int, logs ...logpoller.Log) (added int, dropped int)
// Dequeue pulls logs from the buffer that are within the given block window,
// with a maximum number of logs per upkeep and a total maximum number of logs to return.
// with a maximum number of logs to return.
// It also accepts a boolean to identify if we are operating under minimum dequeue.
// Returns logs (associated to upkeeps) and the number of remaining
// logs in that window for the involved upkeeps.
Expand Down Expand Up @@ -512,7 +512,8 @@ func (q *upkeepLogQueue) clean(blockThreshold int64) int {

for _, blockNumber := range oldBlockNumbers {
delete(q.logs, blockNumber)
delete(q.dequeued, blockNumber)
startWindow, _ := getBlockWindow(blockNumber, int(q.opts.blockRate.Load()))
delete(q.dequeued, startWindow)
}
q.blockNumbers = blockNumbers

Expand Down

0 comments on commit f9a2037

Please sign in to comment.