Skip to content

Commit

Permalink
Limit invalidations for hits metric to current month (#22892) (#22893)
Browse files Browse the repository at this point in the history
  • Loading branch information
sgiehl authored Dec 20, 2024
1 parent d3d1d35 commit f0dab35
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions core/Updates/5.2.0-b6.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)
];

Expand Down

0 comments on commit f0dab35

Please sign in to comment.