Skip to content

Commit

Permalink
fix: missing one parameter of Set function for gopkg.in/cheggaaa/pb
Browse files Browse the repository at this point in the history
when updating the package gopkg.in/cheggaaa/pb.v2 to v2.0.7.

Signed-off-by: James Lu <james.lu@suse.com>
  • Loading branch information
mantissahz authored and innobead committed Mar 8, 2024
1 parent a2b5865 commit 9ff2e86
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/cmd/restore_to_file.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,15 @@ func restore(url string, concurrentLimit int) error {
bar := pb.StartNew(100)
periodicChecker := time.NewTicker(PeriodicRefreshIntervalInSeconds * time.Second)

progressKeyName := requestedBackupName + util.RandomID()
for range periodicChecker.C {
restoreObj.Lock()
restoreProgress := restoreObj.Progress
restoreError := restoreObj.Error
restoreObj.Unlock()

if restoreProgress == 100 {
bar.Set(restoreProgress)
bar.Set(progressKeyName, restoreProgress)
bar.Finish()
periodicChecker.Stop()
return nil
Expand All @@ -111,7 +112,7 @@ func restore(url string, concurrentLimit int) error {
periodicChecker.Stop()
return fmt.Errorf("%v", restoreError)
}
bar.Set(restoreProgress)
bar.Set(progressKeyName, restoreProgress)
}
return nil
}
Expand Down

0 comments on commit 9ff2e86

Please sign in to comment.