diff options
author | diosmosis <benaka@piwik.pro> | 2014-11-27 05:48:51 +0300 |
---|---|---|
committer | diosmosis <benaka@piwik.pro> | 2014-11-27 05:48:51 +0300 |
commit | 223da4a7ba7408fedd7d3bbe2263a261b05bd1d4 (patch) | |
tree | d4b45f249bba96bea264adeae7c46354fbb1b1cf /core/CronArchive.php | |
parent | a58c81e24ff5df171358b17f9e46676ccf857d47 (diff) | |
parent | 04ee32f702ce3da3f1deb67302e689afecbe0b50 (diff) |
Merge branch 'master' into processed_metrics_metadata
Conflicts:
tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_scheduled_report_in_csv__ScheduledReports.generateReport_month.original.csv
tests/PHPUnit/System/expected/test_TwoVisitors_twoWebsites_differentDays_scheduled_report_in_html_tables_only__ScheduledReports.generateReport_month.original.html
tests/PHPUnit/System/expected/test_apiGetReportMetadata__API.getReportMetadata_day.xml
tests/PHPUnit/System/expected/test_ecommerceOrderWithItems_scheduled_report_in_html_tables_only__ScheduledReports.generateReport_week.original.html
Diffstat (limited to 'core/CronArchive.php')
-rw-r--r-- | core/CronArchive.php | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/core/CronArchive.php b/core/CronArchive.php index eff5e0277d..eb4e45e383 100644 --- a/core/CronArchive.php +++ b/core/CronArchive.php @@ -458,9 +458,9 @@ class CronArchive // (*) If there was some old reports invalidated for this website // we make sure all these old reports are triggered at least once - $websiteIsOldDataInvalidate = $this->isOldReportInvalidatedForWebsite($idSite); + $websiteInvalidatedShouldReprocess = $this->isOldReportInvalidatedForWebsite($idSite); - if ($websiteIsOldDataInvalidate) { + if ($websiteInvalidatedShouldReprocess) { $shouldArchivePeriods = true; } @@ -478,7 +478,7 @@ class CronArchive $skipDayArchive = $existingArchiveIsValid; // Invalidate old website forces the archiving for this site - $skipDayArchive = $skipDayArchive && !$websiteIsOldDataInvalidate; + $skipDayArchive = $skipDayArchive && !$websiteInvalidatedShouldReprocess; // Also reprocess when day has ended since last run if ($dayHasEndedMustReprocess @@ -532,6 +532,14 @@ class CronArchive Option::set($this->lastRunKey($idSite, "periods"), time()); } + if(!$success) { + // cancel marking the site as reprocessed + if($websiteInvalidatedShouldReprocess) { + $store = new InvalidatedReports(); + $store->addInvalidatedSitesToReprocess(array($idSite)); + } + } + $this->archivedPeriodsArchivesWebsite++; $requestsWebsite = $this->requests - $requestsBefore; |