From dcb5283621d5cbe54eae4a2975d170fdd93de28b Mon Sep 17 00:00:00 2001 From: James Lu Date: Tue, 5 Mar 2024 10:50:23 +0800 Subject: [PATCH] fix: missing one parameter of Set function for gopkg.in/cheggaaa/pb when updating the package gopkg.in/cheggaaa/pb.v2 to v2.0.7. Signed-off-by: James Lu --- app/cmd/restore_to_file.go | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/cmd/restore_to_file.go b/app/cmd/restore_to_file.go index 68b142f65..0497c7095 100644 --- a/app/cmd/restore_to_file.go +++ b/app/cmd/restore_to_file.go @@ -94,6 +94,7 @@ 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 @@ -101,7 +102,7 @@ func restore(url string, concurrentLimit int) error { restoreObj.Unlock() if restoreProgress == 100 { - bar.Set(restoreProgress) + bar.Set(progressKeyName, restoreProgress) bar.Finish() periodicChecker.Stop() return nil @@ -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 }