From 74781f4f9a6d11f69db53efa942077cdb10d1722 Mon Sep 17 00:00:00 2001 From: Joe Reuss Date: Wed, 6 Dec 2023 16:14:20 -0600 Subject: [PATCH] Fix progress bar for recursive downloads Recursive download progress bar was panicing and exiting when we did not want it to. This patch is just a band-aid to keep functionality but they still do not look pretty when debug logging is enabled. --- client/handle_http.go | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/client/handle_http.go b/client/handle_http.go index a6ece1046..0fb7f83e7 100644 --- a/client/handle_http.go +++ b/client/handle_http.go @@ -362,7 +362,10 @@ func download_http(sourceUrl *url.URL, destination string, payload *payloadStruc downloadError = errors.New("failed to get outputs from one of the transfers") } } - + // Make sure to close the progressContainer after all download complete + if ObjectClientOptions.Recursive { + progressContainer.Wait() + } return downloaded, downloadError } @@ -646,7 +649,12 @@ Loop: } else { progressBar.SetTotal(contentLength, true) // call wait here for the bar to complete and flush - progressContainer.Wait() + // If recursive, we still want to use container so keep it open + if ObjectClientOptions.Recursive { + progressBar.Wait() + } else { // Otherwise just close it + progressContainer.Wait() + } } } break Loop