Skip to content

Commit

Permalink
Add logging of when pruning happens and whether it was fully completed
Browse files Browse the repository at this point in the history
  • Loading branch information
reductionista committed Aug 21, 2024
1 parent a4216cd commit 3101bcf
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion core/chains/evm/logpoller/log_poller.go
Original file line number Diff line number Diff line change
Expand Up @@ -657,11 +657,15 @@ func (lp *logPoller) backgroundWorkerRun() {
blockPruneTick = time.After(utils.WithJitter(lp.pollPeriod * 100))
}
case <-logPruneTick:
lp.lggr.Infow("Pruning LogPoller logs...")
logPruneTick = time.After(utils.WithJitter(lp.pollPeriod * 2401)) // = 7^5 avoids common factors with 1000
allRemoved, err := lp.PruneExpiredLogs(ctx)
if !allRemoved {
if allRemoved {
lp.lggr.Infow("Finished pruning LogPoller logs. Next pruning in ~ %s", lp.pollPeriod*2401)

Check failure on line 664 in core/chains/evm/logpoller/log_poller.go

View workflow job for this annotation

GitHub Actions / lint

odd number of arguments passed as key-value pairs for logging (loggercheck)
} else {
// Tick faster when cleanup can't keep up with the pace of new logs
logPruneTick = time.After(utils.WithJitter(lp.pollPeriod * 241))
lp.lggr.Warnw("Partially finished pruning LogPoller logs. Will resume in ~ %s", lp.pollPeriod*241)

Check failure on line 668 in core/chains/evm/logpoller/log_poller.go

View workflow job for this annotation

GitHub Actions / lint

odd number of arguments passed as key-value pairs for logging (loggercheck)
}
if err != nil {
lp.lggr.Errorw("Unable to prune expired logs", "err", err)
Expand Down

0 comments on commit 3101bcf

Please sign in to comment.