Skip to content

Commit 0f6245b

Browse files
dktappsondrejmirtes
authored andcommitted
Do not clear old containers in worker processes
1 parent b726e08 commit 0f6245b

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

src/Command/CommandHelper.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,8 @@ public static function begin(
4747
bool $manageMemoryLimitFile = true,
4848
bool $debugEnabled = false,
4949
?string $singleReflectionFile = null,
50-
?string $singleReflectionInsteadOfFile = null
50+
?string $singleReflectionInsteadOfFile = null,
51+
bool $cleanupContainerCache = true
5152
): InceptionResult
5253
{
5354
if (!$allowXdebug) {
@@ -235,7 +236,9 @@ public static function begin(
235236
throw new \PHPStan\Command\InceptionNotSuccessfulException();
236237
}
237238

238-
$containerFactory->clearOldContainers($tmpDir);
239+
if ($cleanupContainerCache) {
240+
$containerFactory->clearOldContainers($tmpDir);
241+
}
239242

240243
if (count($paths) === 0) {
241244
$errorOutput->writeLineFormatted('At least one path must be specified to analyse.');

src/Command/FixerWorkerCommand.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,8 @@ protected function execute(InputInterface $input, OutputInterface $output): int
114114
false,
115115
false,
116116
$singleReflectionFile,
117-
$insteadOfFile
117+
$insteadOfFile,
118+
false
118119
);
119120
} catch (\PHPStan\Command\InceptionNotSuccessfulException $e) {
120121
return 1;

src/Command/WorkerCommand.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,9 @@ protected function execute(InputInterface $input, OutputInterface $output): int
107107
$allowXdebug,
108108
false,
109109
false,
110-
$singleReflectionFile
110+
$singleReflectionFile,
111+
null,
112+
false
111113
);
112114
} catch (\PHPStan\Command\InceptionNotSuccessfulException $e) {
113115
return 1;

0 commit comments

Comments
 (0)