Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Core] Add $seconds, $maxNumberOfProcess, and $jobSize parameters to RectorConfig::parallel() method #2188

Merged
merged 5 commits into from
Apr 28, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
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
6 changes: 5 additions & 1 deletion packages/Config/RectorConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,10 +48,14 @@ public function disableParallel(): void
$parameters->set(Option::PARALLEL, false);
}

public function parallel(): void
public function parallel(int $seconds = 120, int $maxNumberOfProcess = 16, int $jobSize = 20): void
{
$parameters = $this->parameters();
$parameters->set(Option::PARALLEL, true);

$parameters->set(Option::PARALLEL_TIMEOUT_IN_SECONDS, $seconds);
$parameters->set(Option::PARALLEL_MAX_NUMBER_OF_PROCESSES, $maxNumberOfProcess);
$parameters->set(Option::PARALLEL_JOB_SIZE, $jobSize);
}

/**
Expand Down
3 changes: 3 additions & 0 deletions src/Configuration/Option.php
Original file line number Diff line number Diff line change
Expand Up @@ -186,16 +186,19 @@ final class Option
public const PARALLEL_PORT = 'port';

/**
* @deprecated Use @see \Rector\Config\RectorConfig::parallel() instead with pass int $jobSize parameter
* @var string
*/
public const PARALLEL_JOB_SIZE = 'parallel-job-size';

/**
* @deprecated Use @see \Rector\Config\RectorConfig::parallel() instead with pass int $maxNumberOfProcess parameter
* @var string
*/
public const PARALLEL_MAX_NUMBER_OF_PROCESSES = 'parallel-max-number-of-processes';

/**
* @deprecated Use @see \Rector\Config\RectorConfig::parallel() instead with pass int $seconds parameter
* @var string
*/
public const PARALLEL_TIMEOUT_IN_SECONDS = 'parallel-timeout-in-seconds';
Expand Down