From c892b21a0a3a2453c98c9b41856534ed6dfab0ca Mon Sep 17 00:00:00 2001 From: Stefan Giehl Date: Fri, 20 Dec 2024 14:21:23 +0100 Subject: [PATCH] Limit invalidations for hits metric to current month (#22892) --- core/Updates/5.2.0-b6.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/core/Updates/5.2.0-b6.php b/core/Updates/5.2.0-b6.php index c2b8dba6c05..439479201f3 100644 --- a/core/Updates/5.2.0-b6.php +++ b/core/Updates/5.2.0-b6.php @@ -31,17 +31,17 @@ public function __construct(MigrationFactory $factory) public function getMigrations(Updater $updater) { - $startOfCurrentYear = Date::now()->toString('Y') . '-01-01'; + $startOfCurrentMonth = Date::now()->toString('Y-m') . '-01'; $commandToExecute = sprintf( './console core:invalidate-report-data --dates=%s,today --plugin=Actions.Actions_hits', - $startOfCurrentYear + $startOfCurrentMonth ); $migrations = [ - new CustomMigration(function () use ($startOfCurrentYear) { + new CustomMigration(function () use ($startOfCurrentMonth) { $invalidator = StaticContainer::get(ArchiveInvalidator::class); - $invalidator->scheduleReArchiving('all', 'Actions', 'Actions_hits', Date::factory($startOfCurrentYear)); + $invalidator->scheduleReArchiving('all', 'Actions', 'Actions_hits', Date::factory($startOfCurrentMonth)); }, $commandToExecute) ];