Skip to content

Commit

Permalink
fix: persistent task concurrency check (#5806)
Browse files Browse the repository at this point in the history
### Description

A minor error formatting change and `--concurrency` parsing logic change
in order for us to match Go behavior.

### Testing Instructions

Integration test passes:

```
[1 olszewski@chriss-mbp] /Users/olszewski/code/vercel/turborepo/turborepo-tests/integration $ EXPERIMENTAL_RUST_CODEPATH=true .cram_env/bin/prysk --shell=bash tests/persistent_dependencies/10-too-many.t         
.
# Ran 1 tests, 0 skipped, 0 failed.
```


Closes TURBO-1268

Co-authored-by: Chris Olszewski <Chris Olszewski>
  • Loading branch information
chris-olszewski committed Aug 25, 2023
1 parent 9472d6f commit 58afd92
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions crates/turborepo-lib/src/engine/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,8 @@ pub enum ValidateError {
dependant: String,
},
#[error(
"You have {persistent_count} persistent tasks, but `turbo` is configured for concurrency \
of {concurrency}. Set --concurrency to at least {persistent_count}"
"You have {persistent_count} persistent tasks but `turbo` is configured for concurrency \
of {concurrency}. Set --concurrency to at least {}", persistent_count+1
)]
PersistentTasksExceedConcurrency {
persistent_count: u32,
Expand Down
2 changes: 1 addition & 1 deletion crates/turborepo-lib/src/opts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ fn parse_concurrency(concurrency_raw: &str) -> Result<u32> {
};
}
match concurrency_raw.parse::<u32>() {
Ok(concurrency) if concurrency > 1 => Ok(concurrency),
Ok(concurrency) if concurrency >= 1 => Ok(concurrency),
Ok(_) | Err(_) => Err(anyhow!(
"invalid value for --concurrency CLI flag. This should be a positive integer greater \
than or equal to 1: {}",
Expand Down

0 comments on commit 58afd92

Please sign in to comment.