Skip to content

Commit

Permalink
Debug downloading
Browse files Browse the repository at this point in the history
  • Loading branch information
Rustin170506 committed Feb 20, 2023
1 parent 155906c commit d436103
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/cargo/core/package.rs
Original file line number Diff line number Diff line change
Expand Up @@ -658,6 +658,7 @@ impl<'a, 'cfg> Downloads<'a, 'cfg> {
/// eventually be returned from `wait_for_download`. Returns `Some(pkg)` if
/// the package is ready and doesn't need to be downloaded.
pub fn start(&mut self, id: PackageId) -> CargoResult<Option<&'a Package>> {
println!("start download: {}", id);
self.start_inner(id)
.with_context(|| format!("failed to download `{}`", id))
}
Expand Down Expand Up @@ -784,14 +785,15 @@ impl<'a, 'cfg> Downloads<'a, 'cfg> {
token,
data: RefCell::new(Vec::new()),
id,
url,
url: url.clone(),
descriptor,
total: Cell::new(0),
current: Cell::new(0),
start: Instant::now(),
timed_out: Cell::new(None),
retry: Retry::new(self.set.config)?,
};
println!("Downloading {} from {}", id, url);
self.enqueue(dl, handle)?;
self.tick(WhyTick::DownloadStarted)?;

Expand Down

0 comments on commit d436103

Please sign in to comment.