Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions doc/03-cli.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 an 50.

### COMPOSER_IPRESOLVE

Set to `4` or `6` to force IPv4 or IPv6 DNS resolution. This only works when the
Expand Down
9 changes: 8 additions & 1 deletion src/Composer/Util/ProcessExecutor.php
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,9 @@ class ProcessExecutor
public function __construct(?IOInterface $io = null)
{
$this->io = $io;
if (is_numeric($maxJobs = Platform::getEnv('COMPOSER_MAX_PARALLEL_PROCESSES'))) {
$this->maxJobs = max(1, min(50, (int) $maxJobs));
}
}

/**
Expand Down Expand Up @@ -350,7 +353,11 @@ public function setMaxJobs(int $maxJobs): 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;
}
}

/**
Expand Down