Skip to content

Commit

Permalink
max_jobs: default to 2 if we can't compute it, use ceil instead of floor
Browse files Browse the repository at this point in the history
  • Loading branch information
domenkozar committed Oct 15, 2024
1 parent 6e73d13 commit dc7ebaf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion devenv/src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ fn max_jobs() -> u8 {
eprintln!("Failed to get number of logical CPUs: {}", e);
std::num::NonZeroUsize::new(4).unwrap()
});
num_cpus.get().div_ceil(2) as u8
std::cmp::max(num_cpus.get().div_ceil(2), 2) as u8
}

#[cfg(test)]
Expand Down

0 comments on commit dc7ebaf

Please sign in to comment.