Skip to content
Open
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
1 change: 1 addition & 0 deletions crates/uv-bench/benches/uv.rs
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ mod resolver {
client,
&build_context,
concurrency.downloads_semaphore.clone(),
concurrency.source_distribution_semaphore.clone(),
),
)?;

Expand Down
3 changes: 3 additions & 0 deletions crates/uv-configuration/src/concurrency.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ pub struct Concurrency {
pub downloads_semaphore: Arc<Semaphore>,
/// A global semaphore to limit the number of concurrent builds.
pub builds_semaphore: Arc<Semaphore>,
/// A global semaphore to limit the number of concurrent source distribution preparations.
pub source_distribution_semaphore: Arc<Semaphore>,
}

/// Custom `Debug` to hide semaphore fields from `--show-settings` output.
Expand Down Expand Up @@ -56,6 +58,7 @@ impl Concurrency {
installs,
downloads_semaphore: Arc::new(Semaphore::new(downloads)),
builds_semaphore: Arc::new(Semaphore::new(builds)),
source_distribution_semaphore: Arc::new(Semaphore::new(builds)),
}
}

Expand Down
2 changes: 2 additions & 0 deletions crates/uv-dispatch/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,7 @@ impl BuildContext for BuildDispatch<'_> {
self.client,
self,
self.concurrency.downloads_semaphore.clone(),
self.concurrency.source_distribution_semaphore.clone(),
)
.with_build_stack(build_stack),
)?;
Expand Down Expand Up @@ -361,6 +362,7 @@ impl BuildContext for BuildDispatch<'_> {
self.client,
self,
self.concurrency.downloads_semaphore.clone(),
self.concurrency.source_distribution_semaphore.clone(),
)
.with_build_stack(build_stack),
);
Expand Down
3 changes: 2 additions & 1 deletion crates/uv-distribution/src/distribution_database.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,11 @@ impl<'a, Context: BuildContext> DistributionDatabase<'a, Context> {
client: &'a RegistryClient,
build_context: &'a Context,
downloads_semaphore: Arc<Semaphore>,
source_distribution_semaphore: Arc<Semaphore>,
) -> Self {
Self {
build_context,
builder: SourceDistributionBuilder::new(build_context),
builder: SourceDistributionBuilder::new(build_context, source_distribution_semaphore),
client: ManagedClient::new(client, downloads_semaphore),
reporter: None,
}
Expand Down
Loading
Loading