diff options
Diffstat (limited to 'plugins/CoreAdminHome/Tasks.php')
-rw-r--r-- | plugins/CoreAdminHome/Tasks.php | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/plugins/CoreAdminHome/Tasks.php b/plugins/CoreAdminHome/Tasks.php index c3afd5562d..aa026de425 100644 --- a/plugins/CoreAdminHome/Tasks.php +++ b/plugins/CoreAdminHome/Tasks.php @@ -32,6 +32,7 @@ use Piwik\Scheduler\Schedule\SpecificTime; use Piwik\Settings\Storage\Backend\MeasurableSettingsTable; use Piwik\Tracker\Failures; use Piwik\Site; +use Piwik\Tracker\FingerprintSalt; use Piwik\Tracker\Visit\ReferrerSpamFilter; use Psr\Log\LoggerInterface; use Piwik\SettingsPiwik; @@ -67,6 +68,8 @@ class Tasks extends \Piwik\Plugin\Tasks // sure all archives that need to be invalidated get invalidated $this->daily('invalidateOutdatedArchives', null, self::HIGH_PRIORITY); + $this->daily('deleteOldFingerprintSalts', null, self::HIGH_PRIORITY); + // general data purge on older archive tables, executed daily $this->daily('purgeOutdatedArchives', null, self::HIGH_PRIORITY); @@ -89,6 +92,11 @@ class Tasks extends \Piwik\Plugin\Tasks $this->scheduleTrackingCodeReminderChecks(); } + public function deleteOldFingerprintSalts() + { + StaticContainer::get(FingerprintSalt::class)->deleteOldSalts(); + } + public function invalidateOutdatedArchives() { if (!Rules::isBrowserTriggerEnabled()) { @@ -278,6 +286,12 @@ class Tasks extends \Piwik\Plugin\Tasks if (empty($purgedDates[$yesterdayStr])) { $this->archivePurger->purgeInvalidatedArchivesFrom($yesterday); } + + // handle year start table + $yearStart = $today->toString('Y-01'); + if (empty($purgedDates[$yearStart])) { + $this->archivePurger->purgeInvalidatedArchivesFrom(Date::factory($yearStart . '-01')); + } } public function optimizeArchiveTable() |