Add COMPOSER_MAX_PARALLEL_PROCESSES (#12356)
parent
fc5a3dd2d7
commit
d0e4fbad7f
|
@ -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
|
concurrency maybe you want to lower this. Increasing it should generally not result
|
||||||
in performance gains.
|
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
|
### COMPOSER_IPRESOLVE
|
||||||
|
|
||||||
Set to `4` or `6` to force IPv4 or IPv6 DNS resolution. This only works when the
|
Set to `4` or `6` to force IPv4 or IPv6 DNS resolution. This only works when the
|
||||||
|
|
|
@ -78,6 +78,7 @@ class ProcessExecutor
|
||||||
public function __construct(?IOInterface $io = null)
|
public function __construct(?IOInterface $io = null)
|
||||||
{
|
{
|
||||||
$this->io = $io;
|
$this->io = $io;
|
||||||
|
$this->resetMaxJobs();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -350,7 +351,11 @@ class ProcessExecutor
|
||||||
|
|
||||||
public function resetMaxJobs(): void
|
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;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue