Skip to content

Commit

Permalink
Add optimization
Browse files Browse the repository at this point in the history
  • Loading branch information
ycombinator committed Oct 12, 2023
1 parent 89ca86b commit da06f8c
Showing 1 changed file with 5 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ func (dp *downloadProgressReporter) Report(ctx context.Context) {
length := dp.length
interval := dp.interval

// If there are no observers to report progress to, there is nothing to do!
if len(dp.progressObservers) == 0 {
return
}

go func() {
t := time.NewTicker(interval)
defer t.Stop()
Expand Down

0 comments on commit da06f8c

Please sign in to comment.