Skip to content
Merged
Show file tree
Hide file tree
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
8 changes: 6 additions & 2 deletions crates/pixi_reporters/src/download_verify_reporter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,13 @@ impl BuildDownloadVerifyReporter {
// Clear all items that have finished processing.
entries.retain(|_, item| !item.is_finished());

// Drop the write lock to the entries. The progress bar also requires access to
// entries so holding on to the write lock might deadlock!
let is_empty = entries.is_empty();
drop(entries);

// Clear or update the progress bar.
if entries.is_empty() {
if is_empty {
// We cannot clear the progress bar and restart it later, so replacing it with a
// new hidden one is currently the only option.
self.title = Some(self.pb.prefix());
Expand All @@ -130,7 +135,6 @@ impl BuildDownloadVerifyReporter {
self.pb.finish_and_clear();
self.pb = new_pb;
} else {
drop(entries);
self.update()
}
}
Expand Down
8 changes: 6 additions & 2 deletions crates/pixi_reporters/src/main_progress_bar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,13 @@ impl<T: Tracker> State<T> {
// Clear all items that have finished processing.
trackers.retain(|_, item| item.finished.is_none());

// Drop the write lock to the trackers. The progress bar also requires access to
// entries so holding on to the write lock might deadlock!
let is_empty = trackers.is_empty();
drop(trackers);

// Clear or update the progress bar.
if trackers.is_empty() {
if is_empty {
// We cannot clear the progress bar and restart it later, so replacing it with a
// new hidden one is currently the only option.
self.title = Some(self.pb.prefix());
Expand All @@ -124,7 +129,6 @@ impl<T: Tracker> State<T> {
self.pb.finish_and_clear();
self.pb = new_pb;
} else {
drop(trackers);
self.update()
}
}
Expand Down
Loading