From 69223601798f7907c68fe7d5d59520bf2a6b693b Mon Sep 17 00:00:00 2001 From: greatroar <61184462+greatroar@users.noreply.github.com> Date: Sun, 9 Oct 2022 14:13:37 +0200 Subject: [PATCH] ui/backup: Remove unused ProgressReporter type, Progress field --- internal/ui/backup/progress.go | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/internal/ui/backup/progress.go b/internal/ui/backup/progress.go index a4b641fe9..d57a5308b 100644 --- a/internal/ui/backup/progress.go +++ b/internal/ui/backup/progress.go @@ -39,18 +39,6 @@ type fileWorkerMessage struct { done bool } -type ProgressReporter interface { - CompleteItem(item string, previous, current *restic.Node, s archiver.ItemStats, d time.Duration) - StartFile(filename string) - CompleteBlob(filename string, bytes uint64) - ScannerError(item string, err error) error - ReportTotal(item string, s archiver.ScanStats) - SetMinUpdatePause(d time.Duration) - Run(ctx context.Context) error - Error(item string, err error) error - Finish(snapshotID restic.ID) -} - type Summary struct { sync.Mutex Files, Dirs struct { @@ -69,8 +57,6 @@ type Progress struct { start time.Time dry bool - totalBytes uint64 - totalCh chan Counter processedCh chan Counter errCh chan struct{} @@ -130,7 +116,6 @@ func (p *Progress) Run(ctx context.Context) error { } else { // scan has finished p.totalCh = nil - p.totalBytes = total.Bytes } case s := <-p.processedCh: processed.Files += s.Files @@ -312,8 +297,7 @@ func (p *Progress) Finish(snapshotID restic.ID) { p.printer.Finish(snapshotID, p.start, p.summary, p.dry) } -// SetMinUpdatePause sets b.MinUpdatePause. It satisfies the -// ArchiveProgressReporter interface. +// SetMinUpdatePause sets b.MinUpdatePause. func (p *Progress) SetMinUpdatePause(d time.Duration) { p.MinUpdatePause = d }