Keep the progress line of a multi-path snapshot within 100% (closes #271)
check / check (push) Waiting to run
check / check (push) Waiting to run
One progress reporter spans every path of a snapshot. Its counts of files and bytes processed run across all the paths, while the totals they were divided by were reset to each path's own, so a second path smaller than the first showed more than 100% and an ETA of `unknown`. The totals now add up over the paths scanned so far. The rate behind the ETA is measured from the bytes processed since the current path's scan phase ended, so a later path's scan phase does not lower it. SetTotalSize is renamed AddTotalSize because it now adds. The issue says the ETA went negative; it was computed negative and printed as `unknown`. Model: opus-5-5
This commit is contained in:
@@ -407,8 +407,8 @@ func (s *Scanner) summarizeScanPhase(
|
||||
}
|
||||
|
||||
if s.progress != nil {
|
||||
s.progress.SetTotalSize(totalSizeToProcess)
|
||||
s.progress.GetStats().TotalFiles.Store(int64(len(filesToProcess)))
|
||||
s.progress.AddTotalSize(totalSizeToProcess)
|
||||
s.progress.GetStats().TotalFiles.Add(int64(len(filesToProcess)))
|
||||
}
|
||||
|
||||
log.Info("Phase 1 complete",
|
||||
|
||||
Reference in New Issue
Block a user