-
Notifications
You must be signed in to change notification settings - Fork 643
admin/upload_index: Use indicatif
for progress reporting
#4836
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
Conversation
Just a consideration: I'm not sure where the admin tasks run, but I'd expect it would need to support clearing the current line for a progress bar to work properly. If we really get impatient, we could upload in parallel and probably get at least a 10x speedup 😀. |
let crate_name = file.file_name().unwrap().to_str().unwrap(); | ||
let path = repo.index_file(crate_name); | ||
if !path.exists() { | ||
println!("skipping file `{}`", crate_name); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why remove this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it looks like when we call println!()
while a progressbar is active it does not print the message, but instead freezes the progressbar and continues it on the next line. I guess it doesn't play well with the clearing of the current line.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The motivation looks reasonable to me!
☔ The latest upstream changes (presumably 30e6673) made this pull request unmergeable. Please resolve the merge conflicts. |
I tried it out on Heroku and it seems to work as expected :) |
This PR uses https://github.com/console-rs/indicatif to display a progress bar while backfilling the HTTP-based index, with the main advantage of having a somewhat reasonable ETA display :)
/cc @arlosi