Skip to content

Commit

Permalink
run: Treat jj run -j0 <command> as use all available cores
Browse files Browse the repository at this point in the history
Waleed noticed this is #3638.
  • Loading branch information
PhilipMetzger committed Jul 24, 2024
1 parent ef05604 commit 687d613
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cli/src/commands/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ pub fn cmd_run(ui: &mut Ui, command: &CommandHelper, args: &RunArgs) -> Result<(
// 2. the amount of cores available.
// 3. a single job, if all of the above fails.
let _jobs = match args.jobs {
Some(0) => return Err(user_error("must pass at least one job")),
Some(0) => std::thread::available_parallelism().map(|t| t.into()).ok(),
Some(jobs) => Some(jobs),
None => std::thread::available_parallelism().map(|t| t.into()).ok(),
}
Expand Down

0 comments on commit 687d613

Please sign in to comment.