diff --git a/pkg/sources/job_progress.go b/pkg/sources/job_progress.go index 1b7bc6ac2..e3965e4e6 100644 --- a/pkg/sources/job_progress.go +++ b/pkg/sources/job_progress.go @@ -355,6 +355,10 @@ func (m JobProgressMetrics) PercentComplete() int { // Fallback to the source's self-reported percent complete if // the unit information isn't available. return int(m.SourcePercent) + } else if den == 0 { + // This should never happen. Return an invalid value so we can + // trace it back to here if we ever see it. + return -1 } return int(num * 100 / den) } diff --git a/pkg/sources/source_manager.go b/pkg/sources/source_manager.go index 48f369ec3..68dd57f77 100644 --- a/pkg/sources/source_manager.go +++ b/pkg/sources/source_manager.go @@ -417,6 +417,7 @@ func (s *SourceManager) scan(ctx context.Context, source Source, report *JobProg } }() + report.ReportUnit(unit) report.TrackProgress(source.GetProgress()) if ctx.Value("job_id") == "" { ctx = context.WithValue(ctx, "job_id", report.JobID)