mirror of
https://github.com/rectorphp/rector.git
synced 2024-06-07 03:40:50 +00:00
[Core] Add $seconds, $maxNumberOfProcess, and $jobSize parameters to RectorConfig::parallel() method (#2188)
This commit is contained in:
parent
b055a88927
commit
680e8a1e3d
|
@ -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);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -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';
|
||||
|
|
Loading…
Reference in New Issue
Block a user