Skip to content

Commit

Permalink
go bar.SetRefill
Browse files Browse the repository at this point in the history
SetRefill isn't as critical as SetCurrent, so can be offloaded.
  • Loading branch information
vbauerster committed Mar 11, 2024
1 parent 7202770 commit 87bae39
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions session.go
Original file line number Diff line number Diff line change
Expand Up @@ -265,9 +265,9 @@ func (s Session) makeTotalBar(progress *mpb.Progress, partsDone *uint32, quiet b
),
)
if written := s.totalWritten(); written != 0 {
bar.SetCurrent(written)
bar.SetRefill(written)
bar.DecoratorAverageAdjust(time.Now().Add(-s.Elapsed))
bar.SetCurrent(written)
go bar.SetRefill(written)
}
return bar
}

0 comments on commit 87bae39

Please sign in to comment.