Skip to content

Commit

Permalink
Fix merge conflicts
Browse files Browse the repository at this point in the history
Also fixes issues with progress bars for recursive uploads. It is at the
same state as recursive downloads so it looks fine without debug logging
but is wonky with it. Functionality should work fine.
  • Loading branch information
joereuss12 committed Dec 5, 2023
1 parent 8fbc66f commit bf4ba6d
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
11 changes: 10 additions & 1 deletion client/handle_http.go
Original file line number Diff line number Diff line change
Expand Up @@ -768,6 +768,10 @@ func UploadDirectory(src string, dest *url.URL, token string, namespace namespac
}
amountDownloaded += downloaded
}
// Close progress bar container
if ObjectClientOptions.ProgressBars {
progressContainer.Wait()
}
return amountDownloaded, err
}

Expand Down Expand Up @@ -873,7 +877,12 @@ func UploadFile(src string, origDest *url.URL, token string, namespace namespace
} else {
progressBar.Abort(true)
}
progressContainer.Wait()
// If it is recursive, we need to reuse the mpb instance. Closed later
if ObjectClientOptions.Recursive {
progressBar.Wait()
} else { // If not recursive, go ahead and close it
progressContainer.Wait()
}
}()
}
tickerDuration := 500 * time.Millisecond
Expand Down
1 change: 1 addition & 0 deletions cmd/object_copy.go
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,7 @@ func copyMain(cmd *cobra.Command, args []string) {
for _, src := range source {
var tmpDownloaded int64
isRecursive, _ := cmd.Flags().GetBool("recursive")
client.ObjectClientOptions.Recursive = isRecursive
tmpDownloaded, result = client.DoStashCPSingle(src, dest, splitMethods, isRecursive)
downloaded += tmpDownloaded
if result != nil {
Expand Down

0 comments on commit bf4ba6d

Please sign in to comment.