Skip to content

Commit

Permalink
Revert countBasedPruningActive flag
Browse files Browse the repository at this point in the history
  • Loading branch information
reductionista committed Oct 8, 2024
1 parent 4fa5caa commit c4aa462
Showing 1 changed file with 1 addition and 9 deletions.
10 changes: 1 addition & 9 deletions core/chains/evm/logpoller/log_poller.go
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,7 @@ type logPoller struct {
// Usually the only way to recover is to manually remove the offending logs and block from the database.
// LogPoller keeps running in infinite loop, so whenever the invalid state is removed from the database it should
// recover automatically without needing to restart the LogPoller.
finalityViolated *atomic.Bool
countBasedLogPruningActive *atomic.Bool
finalityViolated *atomic.Bool
}

type Opts struct {
Expand Down Expand Up @@ -293,9 +292,6 @@ func (lp *logPoller) RegisterFilter(ctx context.Context, filter Filter) error {
}
lp.filters[filter.Name] = filter
lp.filterDirty = true
if filter.MaxLogsKept > 0 {
lp.countBasedLogPruningActive.Store(true)
}
return nil
}

Expand Down Expand Up @@ -1154,10 +1150,6 @@ func (lp *logPoller) PruneExpiredLogs(ctx context.Context) (bool, error) {
done = false
}

if !lp.countBasedLogPruningActive.Load() {
return done, err
}

rowIDs, err := lp.orm.SelectExcessLogIDs(ctx, lp.logPrunePageSize)
if err != nil {
lp.lggr.Errorw("Unable to find excess logs for pruning", "err", err)
Expand Down

0 comments on commit c4aa462

Please sign in to comment.