1
0
mirror of https://github.com/danog/psalm.git synced 2025-01-22 05:41:20 +01:00

Use config threads if lower than detected threads

This commit is contained in:
m1ke 2022-01-20 09:50:01 +00:00
parent 1b8f337748
commit 2fdae4ae16

View File

@ -249,7 +249,7 @@ final class Psalm
$options['long-progress'] = true;
}
$threads = self::detectThreads($options, $in_ci);
$threads = self::useThreads($options, $in_ci, $config);
self::emitMacPcreWarning($options, $threads);
@ -1337,4 +1337,14 @@ final class Psalm
HELP;
}
private static function useThreads(array $options, bool $in_ci, Config $config): int{
$threads = self::detectThreads($options, $in_ci);
if ($config->threads && $config->threads<$threads) {
$threads = $config->threads;
}
return $threads;
}
}