Skip to content

Commit

Permalink
downloader: use after (#8315) (#8316)
Browse files Browse the repository at this point in the history
Co-authored-by: Alex Sharov <[email protected]>
  • Loading branch information
yperbasis and AskAlexSharov authored Sep 28, 2023
1 parent f00cf37 commit b8744d9
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions erigon-lib/downloader/downloader.go
Original file line number Diff line number Diff line change
Expand Up @@ -236,15 +236,11 @@ func (d *Downloader) mainLoop(silent bool) error {
}(t)
}

func() { // scop of sleep timer
timer := time.NewTimer(10 * time.Second)
defer timer.Stop()
select {
case <-d.ctx.Done():
return
case <-timer.C:
}
}()
select {
case <-d.ctx.Done():
return
case <-time.After(10 * time.Second):
}
}
}()

Expand Down

0 comments on commit b8744d9

Please sign in to comment.