2
2
mirror of https://github.com/octoleo/restic.git synced 2024-12-22 10:58:55 +00:00

ui/backup: Remove unused ProgressReporter type, Progress field

This commit is contained in:
greatroar 2022-10-09 14:13:37 +02:00
parent d4aadfa389
commit 6922360179

View File

@ -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
}