Skip to content

Commit 0fee815

Browse files
committed
no need to drain
1 parent 9d6c78a commit 0fee815

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

rollup/pipeline/pipeline.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -313,17 +313,14 @@ func (p *Pipeline) cccStage(candidates <-chan *BlockCandidate, deadline time.Tim
313313
deadlineTimer := time.NewTimer(time.Until(deadline))
314314
defer func() {
315315
close(resultCh)
316-
if !deadlineReached && !deadlineTimer.Stop() {
317-
<-deadlineTimer.C
318-
}
316+
deadlineTimer.Stop()
319317
lifetimeTimer.UpdateSince(p.start)
320318
}()
321319
for {
322320
idleStart := time.Now()
323321
select {
324322
case <-deadlineTimer.C:
325323
cccIdleTimer.UpdateSince(idleStart)
326-
deadlineReached = true
327324
// note: currently we don't allow empty blocks, but if we ever do; make sure to CCC check it first
328325
if lastCandidate != nil {
329326
resultCh <- &Result{
@@ -332,6 +329,7 @@ func (p *Pipeline) cccStage(candidates <-chan *BlockCandidate, deadline time.Tim
332329
}
333330
return
334331
}
332+
deadlineReached = true
335333
case candidate := <-candidates:
336334
cccIdleTimer.UpdateSince(idleStart)
337335
cccStart := time.Now()

0 commit comments

Comments
 (0)