diff options
author | Kate Butler <kate@innocraft.com> | 2019-09-17 01:39:25 +0300 |
---|---|---|
committer | Thomas Steur <tsteur@users.noreply.github.com> | 2019-09-17 01:39:25 +0300 |
commit | 93b7f61ae9ca341f889c1ac36c7fb6bc11ff7736 (patch) | |
tree | 38a2dc764e141cc2be2fca4edf54e495235e80d3 | |
parent | 9f767b4f069adafbcddef2f4cf6c5a4a8333f68b (diff) |
Remove force-optimize-tables option from core:purge-old-archive-data (#14895)
-rw-r--r-- | plugins/CoreAdminHome/Commands/PurgeOldArchiveData.php | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/plugins/CoreAdminHome/Commands/PurgeOldArchiveData.php b/plugins/CoreAdminHome/Commands/PurgeOldArchiveData.php index 8295633339..b9dff8e56f 100644 --- a/plugins/CoreAdminHome/Commands/PurgeOldArchiveData.php +++ b/plugins/CoreAdminHome/Commands/PurgeOldArchiveData.php @@ -60,7 +60,6 @@ class PurgeOldArchiveData extends ConsoleCommand $this->addOption('exclude-ranges', null, InputOption::VALUE_NONE, "Do not purge custom ranges."); $this->addOption('skip-optimize-tables', null, InputOption::VALUE_NONE, "Do not run OPTIMIZE TABLES query on affected archive tables."); $this->addOption('include-year-archives', null, InputOption::VALUE_NONE, "If supplied, the command will purge archive tables that contain year archives for every supplied date."); - $this->addOption('force-optimize-tables', null, InputOption::VALUE_NONE, "If supplied, forces optimize table SQL to be run, even on InnoDB tables."); $this->setHelp("By default old and invalidated archives are purged. Custom ranges are also purged with outdated archives.\n\n" . "Note: archive purging is done during scheduled task execution, so under normal circumstances, you should not need to " . "run this command manually."); @@ -120,7 +119,7 @@ class PurgeOldArchiveData extends ConsoleCommand if ($skipOptimizeTables) { $output->writeln("Skipping OPTIMIZE TABLES."); } else { - $this->optimizeArchiveTables($output, $dates, $input->getOption('force-optimize-tables')); + $this->optimizeArchiveTables($output, $dates); } } @@ -186,21 +185,20 @@ class PurgeOldArchiveData extends ConsoleCommand /** * @param OutputInterface $output * @param Date[] $dates - * @param bool $forceOptimzation */ - private function optimizeArchiveTables(OutputInterface $output, $dates, $forceOptimzation = false) + private function optimizeArchiveTables(OutputInterface $output, $dates) { $output->writeln("Optimizing archive tables..."); foreach ($dates as $date) { $numericTable = ArchiveTableCreator::getNumericTable($date); - $this->performTimedPurging($output, "Optimizing table $numericTable...", function () use ($numericTable, $forceOptimzation) { - Db::optimizeTables($numericTable, $forceOptimzation); + $this->performTimedPurging($output, "Optimizing table $numericTable...", function () use ($numericTable) { + Db::optimizeTables($numericTable, $force = true); }); $blobTable = ArchiveTableCreator::getBlobTable($date); - $this->performTimedPurging($output, "Optimizing table $blobTable...", function () use ($blobTable, $forceOptimzation) { - Db::optimizeTables($blobTable, $forceOptimzation); + $this->performTimedPurging($output, "Optimizing table $blobTable...", function () use ($blobTable) { + Db::optimizeTables($blobTable, $force = true); }); } } |