Skip to content

Commit

Permalink
Fix progress bar for recursive downloads
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
joereuss12 committed Dec 6, 2023
1 parent 9969933 commit 74781f4
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions client/handle_http.go
Original file line number Diff line number Diff line change
Expand Up @@ -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

}
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 74781f4

Please sign in to comment.