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

This commit is contained in:
Abdul Malik Ikhsan 2022-04-29 01:29:13 +07:00 committed by GitHub
parent b055a88927
commit 680e8a1e3d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 1 deletions

View File

@ -48,10 +48,14 @@ final class RectorConfig extends ContainerConfigurator
$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);
}
/**

View File

@ -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';