2
2
mirror of https://github.com/octoleo/restic.git synced 2024-12-23 03:18:55 +00:00

ui: restore a few comments

This commit is contained in:
Michael Eischer 2021-08-18 01:27:22 +02:00
parent 80cbaf6d38
commit 5ccf583b8a

View File

@ -65,6 +65,7 @@ type Summary struct {
archiver.ItemStats
}
// Progress reports progress for the `backup` command.
type Progress struct {
MinUpdatePause time.Duration
@ -100,6 +101,8 @@ func NewProgress(printer ProgressPrinter) *Progress {
}
}
// Run regularly updates the status lines. It should be called in a separate
// goroutine.
func (p *Progress) Run(ctx context.Context) error {
var (
lastUpdate time.Time
@ -309,9 +312,9 @@ func (p *Progress) ReportTotal(item string, s archiver.ScanStats) {
// Finish prints the finishing messages.
func (p *Progress) Finish(snapshotID restic.ID) {
// wait for the status update goroutine to shut down
<-p.closed
summary := p.summary
p.printer.Finish(snapshotID, p.start, summary)
p.printer.Finish(snapshotID, p.start, p.summary)
}
// SetMinUpdatePause sets b.MinUpdatePause. It satisfies the