Skip to content

Commit

Permalink
Update SymfonyCacheClearer.php
Browse files Browse the repository at this point in the history
  • Loading branch information
Codencode committed Jan 16, 2024
1 parent f6f70b7 commit 2dcba3e
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/Adapter/Cache/Clearer/SymfonyCacheClearer.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,16 @@ public function clear()
return;
}

// Warmup prod environment only (not needed for dev since many things are dynamic)
$application = new Application($kernel);
$application->setAutoExit(false);
$input = new ArrayInput([
'command' => 'cache:warmup',
'--no-optional-warmers' => true,
'--env' => 'prod',
'--no-debug' => true,
]);

$environments = ['prod', 'dev'];
foreach ($environments as $environment) {
try {
Expand All @@ -89,16 +99,6 @@ public function clear()
}
}

// Warmup prod environment only (not needed for dev since many things are dynamic)
$application = new Application($kernel);
$application->setAutoExit(false);
$input = new ArrayInput([
'command' => 'cache:warmup',
'--no-optional-warmers' => true,
'--env' => 'prod',
'--no-debug' => true,
]);

$output = new NullOutput();
$application->doRun($input, $output);
} finally {
Expand Down

0 comments on commit 2dcba3e

Please sign in to comment.