From e91426c9795b778062a0c859e985e2c82513d4d7 Mon Sep 17 00:00:00 2001 From: Babak Alizadeh Date: Sun, 27 Apr 2025 15:50:25 +0000 Subject: [PATCH] last version of updater --- hesabixCore/src/Command/UpdateSoftwareCommand.php | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/hesabixCore/src/Command/UpdateSoftwareCommand.php b/hesabixCore/src/Command/UpdateSoftwareCommand.php index 9e508e5..e2b48ab 100644 --- a/hesabixCore/src/Command/UpdateSoftwareCommand.php +++ b/hesabixCore/src/Command/UpdateSoftwareCommand.php @@ -564,7 +564,15 @@ class UpdateSoftwareCommand extends Command private function postUpdateChecks(OutputInterface $output): void { $this->writeOutput($output, 'Running post-update checks...'); + + // Clear cache completely to avoid stale cache issues + $this->writeOutput($output, 'Clearing all caches for the current environment...'); + $this->runProcess(['rm', '-rf', $this->appDir . '/var/cache/*'], $this->appDir, new \Symfony\Component\Console\Output\NullOutput()); + $this->runProcess(['php', 'bin/console', 'cache:clear', "--env={$this->env}"], $this->appDir, $output, 3); + + // Clear cache pools $this->runProcess(['php', 'bin/console', 'cache:pool:clear', 'cache.global_clearer'], $this->appDir, $output, 1); + $this->writeOutput($output, 'Post-update checks completed successfully.'); } } \ No newline at end of file