diff options
author | diosmosis <diosmosis@users.noreply.github.com> | 2020-09-11 04:19:41 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-11 04:19:41 +0300 |
commit | 6b70e8cc7a12e596bfa08e35db52531ce989c2f2 (patch) | |
tree | 151cda62467fb0c5266adb6e901c3bd50499fb2b /plugins/CoreAdminHome | |
parent | d01085cec58a437e30b0dd4b149c52fc3e19abaa (diff) |
Add methods to remove invalidations. (#16400)
* Add methods to remove invalidations.
* Add check if site exists to beginning of queue consumers loop to find archive data
* Delete invalidations w/ no site in task and for site when deleting.
* fix test
* fix test
* another test fix
Diffstat (limited to 'plugins/CoreAdminHome')
-rw-r--r-- | plugins/CoreAdminHome/Tasks.php | 8 | ||||
-rw-r--r-- | plugins/CoreAdminHome/tests/Integration/TasksTest.php | 1 |
2 files changed, 9 insertions, 0 deletions
diff --git a/plugins/CoreAdminHome/Tasks.php b/plugins/CoreAdminHome/Tasks.php index 21008b78a3..9cccf23aba 100644 --- a/plugins/CoreAdminHome/Tasks.php +++ b/plugins/CoreAdminHome/Tasks.php @@ -18,6 +18,7 @@ use Piwik\Config; use Piwik\Container\StaticContainer; use Piwik\CronArchive; use Piwik\DataAccess\ArchiveTableCreator; +use Piwik\DataAccess\Model as CoreModel; use Piwik\Date; use Piwik\Db; use Piwik\Http; @@ -75,6 +76,7 @@ class Tasks extends \Piwik\Plugin\Tasks // general data purge on invalidated archive records, executed daily $this->daily('purgeInvalidatedArchives', null, self::LOW_PRIORITY); + $this->daily('purgeInvalidationsForDeletedSites', null, self::LOW_PRIORITY); $this->weekly('purgeOrphanedArchives', null, self::NORMAL_PRIORITY); @@ -92,6 +94,12 @@ class Tasks extends \Piwik\Plugin\Tasks $this->scheduleTrackingCodeReminderChecks(); } + public function purgeInvalidationsForDeletedSites() + { + $coreModel = new CoreModel(); + $coreModel->deleteInvalidationsForDeletedSites(); + } + public function deleteOldFingerprintSalts() { StaticContainer::get(FingerprintSalt::class)->deleteOldSalts(); diff --git a/plugins/CoreAdminHome/tests/Integration/TasksTest.php b/plugins/CoreAdminHome/tests/Integration/TasksTest.php index e98791a131..9edcbc5fcc 100644 --- a/plugins/CoreAdminHome/tests/Integration/TasksTest.php +++ b/plugins/CoreAdminHome/tests/Integration/TasksTest.php @@ -136,6 +136,7 @@ class TasksTest extends IntegrationTestCase 'deleteOldFingerprintSalts.', 'purgeOutdatedArchives.', 'purgeInvalidatedArchives.', + 'purgeInvalidationsForDeletedSites.', 'purgeOrphanedArchives.', 'optimizeArchiveTable.', 'cleanupTrackingFailures.', |