Skip to content

Commit 15f516f

Browse files
committed
consistent time between tick
1 parent be184de commit 15f516f

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

pruner/service.go

+5
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,11 @@ func (s *Service) run() {
113113

114114
for {
115115
lastPrunedHeader = s.prune(s.ctx, lastPrunedHeader)
116+
// pruning may take a while beyond ticker's time
117+
// and this ensures we don't do idle spins right after the pruning
118+
// and ensures the is always pruneCycle period between each run
119+
ticker.Reset(s.params.pruneCycle)
120+
116121
select {
117122
case <-s.ctx.Done():
118123
return

0 commit comments

Comments
 (0)