diff options
author | Thomas Steur <thomas.steur@googlemail.com> | 2014-12-22 01:59:53 +0300 |
---|---|---|
committer | Thomas Steur <thomas.steur@googlemail.com> | 2014-12-22 01:59:53 +0300 |
commit | 4823afe878f87bafb2df55c70db3bcab49fe3fb6 (patch) | |
tree | d75154f2eb16a5b3ccf482d99bd56e1b7dde54f1 /core/Archive.php | |
parent | a1c74a9043812cd133d65a5a23a4a72ae0cf1928 (diff) |
we do not want to use the API here since it needs admin access
Diffstat (limited to 'core/Archive.php')
-rw-r--r-- | core/Archive.php | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/core/Archive.php b/core/Archive.php index 76a619f0bb..208d6dfdce 100644 --- a/core/Archive.php +++ b/core/Archive.php @@ -13,7 +13,6 @@ use Piwik\ArchiveProcessor\Rules; use Piwik\DataAccess\ArchiveInvalidator; use Piwik\DataAccess\ArchiveSelector; use Piwik\Period\Factory as PeriodFactory; -use Piwik\Plugins\CoreAdminHome\API as CoreAdminHomeApi; /** * The **Archive** class is used to query cached analytics statistics @@ -505,12 +504,21 @@ class Archive $sitesPerDays = $invalidator->getRememberedArchivedReportsThatShouldBeInvalidated(); foreach ($sitesPerDays as $date => $siteIds) { - if (!empty($siteIds)) { + if (empty($siteIds)) { + continue; + } + + try { // an advanced version would only invalidate siteIds for $this->params->getIdSites() but would make // everything way more complex eg the cache above and which siteIds we pass here... - CoreAdminHomeApi::getInstance()->invalidateArchivedReports($siteIds, $date); + $invalidator->markArchivesAsInvalidated($siteIds, $date, false); + } catch (\Exception $e) { + Site::clearCache(); + throw $e; } } + + Site::clearCache(); } /** |