Address review comments

This commit is contained in:
Michael Eischer 2023-06-08 20:24:21 +02:00
parent 0372c7ef04
commit 0b908bb1fb
4 changed files with 42 additions and 67 deletions

View file

@ -76,7 +76,8 @@ func NewProgress(printer ProgressPrinter, interval time.Duration) *Progress {
var secondsRemaining uint64
if p.scanFinished {
rate := p.estimator.rate(time.Now())
if rate <= 0 {
tooSlowCutoff := 1024.
if rate <= tooSlowCutoff {
secondsRemaining = 0
} else {
todo := float64(p.total.Bytes - p.processed.Bytes)