mirror of
https://github.com/restic/restic.git
synced 2025-08-12 10:17:42 +00:00
ui: Simplify ReportTotal methods
This commit is contained in:
@@ -151,13 +151,11 @@ func (b *Backup) CompleteItem(messageType, item string, previous, current *resti
|
|||||||
|
|
||||||
// ReportTotal sets the total stats up to now
|
// ReportTotal sets the total stats up to now
|
||||||
func (b *Backup) ReportTotal(item string, start time.Time, s archiver.ScanStats) {
|
func (b *Backup) ReportTotal(item string, start time.Time, s archiver.ScanStats) {
|
||||||
if item == "" {
|
|
||||||
b.V("scan finished in %.3fs: %v files, %s",
|
b.V("scan finished in %.3fs: %v files, %s",
|
||||||
time.Since(start).Seconds(),
|
time.Since(start).Seconds(),
|
||||||
s.Files, formatBytes(s.Bytes),
|
s.Files, formatBytes(s.Bytes),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
// Reset status
|
// Reset status
|
||||||
func (b *Backup) Reset() {
|
func (b *Backup) Reset() {
|
||||||
|
@@ -157,7 +157,6 @@ func (b *Backup) CompleteItem(messageType, item string, previous, current *resti
|
|||||||
|
|
||||||
// ReportTotal sets the total stats up to now
|
// ReportTotal sets the total stats up to now
|
||||||
func (b *Backup) ReportTotal(item string, start time.Time, s archiver.ScanStats) {
|
func (b *Backup) ReportTotal(item string, start time.Time, s archiver.ScanStats) {
|
||||||
if item == "" {
|
|
||||||
if b.v >= 2 {
|
if b.v >= 2 {
|
||||||
b.print(verboseUpdate{
|
b.print(verboseUpdate{
|
||||||
MessageType: "status",
|
MessageType: "status",
|
||||||
@@ -167,8 +166,6 @@ func (b *Backup) ReportTotal(item string, start time.Time, s archiver.ScanStats)
|
|||||||
TotalFiles: s.Files,
|
TotalFiles: s.Files,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
return
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Finish prints the finishing messages.
|
// Finish prints the finishing messages.
|
||||||
|
Reference in New Issue
Block a user