Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix progress bar for recursive downloads #471

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading