hacky way to configure parallelism

This commit is contained in:
nora 2024-09-08 12:31:28 +02:00
parent 5ef63686f3
commit ae1f0b96e3
2 changed files with 10 additions and 5 deletions

View file

@ -172,10 +172,14 @@ pub async fn build_every_target_for_toolchain(
.await
.wrap_err("failed to get targets")?;
let concurrent = std::thread::available_parallelism()
.unwrap_or(NonZeroUsize::new(2).unwrap())
.get()
/ 2;
let concurrent = std::env::var("DOES_IT_BUILD_PARALLEL_JOBS")
.map(|jobs| jobs.parse().unwrap())
.unwrap_or_else(|_| {
std::thread::available_parallelism()
.unwrap_or(NonZeroUsize::new(2).unwrap())
.get()
/ 2
});
let results = futures::stream::iter(
targets