1
0
mirror of https://github.com/j178/prek.git synced 2026-04-25 02:11:36 +02:00
Files
prek/docs
Doug Richardson 91a1faedcc Add PREK_MAX_CONCURRENCY environment variable (#1697)
## Summary

- Add `PREK_MAX_CONCURRENCY` environment variable to cap the maximum
number of concurrent hooks
- Value is floored at 1; values above CPU count are allowed (useful for
I/O-bound hooks)
- Invalid values show a user-visible warning and fall back to CPU count
- `PREK_NO_CONCURRENCY` takes precedence when both are set

## Motivation

When `ulimit -n` is low, concurrent hook execution can exhaust file
descriptors. This provides an environment variable to limit concurrency.

For #1696

## Test plan

- [x] `mise run lint` — no warnings
- [x] `mise run test` — all tests pass
- [x] Unit tests for `resolve_concurrency`: valid value, above CPU
count, zero floors to 1, invalid string, empty string, unset,
no_concurrency, no_concurrency overrides max

Co-authored-by: Claude <noreply@anthropic.com>
2026-02-27 12:01:53 +08:00
..
2026-01-20 19:44:15 +08:00
2026-01-31 22:34:14 +08:00
2026-01-31 22:34:14 +08:00
2026-02-15 21:20:37 +08:00