1
0
Fork 0

Add COMPOSER_MAX_PARALLEL_PROCESSES (#12356)

pull/12360/head
Maarten Bruna 2025-04-02 13:09:19 +02:00 committed by GitHub
parent fc5a3dd2d7
commit d0e4fbad7f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 11 additions and 1 deletions

View File

@ -1271,6 +1271,11 @@ defaults to 12 and must be between 1 and 50. If your proxy has issues with
concurrency maybe you want to lower this. Increasing it should generally not result
in performance gains.
### COMPOSER_MAX_PARALLEL_PROCESSES
Set to an an integer to configure how many processes can be executed in parallel.
This defaults to 10 and must be between 1 and 50.
### COMPOSER_IPRESOLVE
Set to `4` or `6` to force IPv4 or IPv6 DNS resolution. This only works when the

View File

@ -78,6 +78,7 @@ class ProcessExecutor
public function __construct(?IOInterface $io = null)
{
$this->io = $io;
$this->resetMaxJobs();
}
/**
@ -350,7 +351,11 @@ class ProcessExecutor
public function resetMaxJobs(): void
{
$this->maxJobs = 10;
if (is_numeric($maxJobs = Platform::getEnv('COMPOSER_MAX_PARALLEL_PROCESSES'))) {
$this->maxJobs = max(1, min(50, (int) $maxJobs));
} else {
$this->maxJobs = 10;
}
}
/**