diff options
author | Thomas Steur <tsteur@users.noreply.github.com> | 2020-11-19 07:57:55 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-19 07:57:55 +0300 |
commit | 40ce0672484f6799e11da61d1d0b04bd4213d4fb (patch) | |
tree | 800aeb1165481cc46bc550ea442561abf5154039 | |
parent | c5b517afc7bb23c7b920118ea1ec8c2a824de52d (diff) |
Prevent some archiving notes being printed for each site (#16746)
* Prevent some archiving notes being printed for each site
* no longer call init
-rw-r--r-- | core/CronArchive.php | 5 | ||||
-rw-r--r-- | plugins/CoreAdminHome/Tasks.php | 3 |
2 files changed, 6 insertions, 2 deletions
diff --git a/core/CronArchive.php b/core/CronArchive.php index df98bd3274..fd16a424c7 100644 --- a/core/CronArchive.php +++ b/core/CronArchive.php @@ -765,6 +765,11 @@ class CronArchive return; } + if (empty($this->segmentArchiving)) { + // might not be initialised if init is not called + $this->segmentArchiving = new SegmentArchiving($this->processNewSegmentsFrom, $this->dateLastForced); + } + $this->logger->debug("Checking for queued invalidations..."); // invalidate remembered site/day pairs diff --git a/plugins/CoreAdminHome/Tasks.php b/plugins/CoreAdminHome/Tasks.php index 29444de212..0adfb63973 100644 --- a/plugins/CoreAdminHome/Tasks.php +++ b/plugins/CoreAdminHome/Tasks.php @@ -113,9 +113,8 @@ class Tasks extends \Piwik\Plugin\Tasks } $idSites = Request::processRequest('SitesManager.getAllSitesId'); + $cronArchive = new CronArchive(); foreach ($idSites as $idSite) { - $cronArchive = new CronArchive(); - $cronArchive->init(); $cronArchive->invalidateArchivedReportsForSitesThatNeedToBeArchivedAgain($idSite); } } |