mirror of
https://github.com/restic/restic.git
synced 2026-10-18 07:28:12 +00:00
progress: extract progress updating into Updater struct
This allows reusing the code to create periodic progress updates.
This commit is contained in:
1 parent
52682b1c7b
commit
e499bbe3ae
6 files changed
+152
-83
No files matched your search
@@ -37,7 +37,7 @@ func newProgressMax(show bool, max uint64, description string) *progress.Counter
|
||||
interval := calculateProgressInterval(show, false)
|
||||
canUpdateStatus := stdoutCanUpdateStatus()
|
||||
|
||||
return progress.New(interval, max, func(v uint64, max uint64, d time.Duration, final bool) {
|
||||
return progress.NewCounter(interval, max, func(v uint64, max uint64, d time.Duration, final bool) {
|
||||
var status string
|
||||
if max == 0 {
|
||||
status = fmt.Sprintf("[%s] %d %s",
|
||||
|
||||
Reference in new issue
Block a user