diff options
author | mattab <matthieu.aubry@gmail.com> | 2014-11-27 02:55:17 +0300 |
---|---|---|
committer | mattab <matthieu.aubry@gmail.com> | 2014-11-27 02:55:17 +0300 |
commit | 46a834d5297b8560b48807713753358f74e925a6 (patch) | |
tree | 1519de39d67e8d1c519ab4bcff441d3e0d47857d /core | |
parent | 93db9612cce6a50832ee480f494462f30c7b38b4 (diff) |
Fixes #6730 when period archiving fails (or any of segments fails) then we will make sure to re-process the data for this website in the next run
Diffstat (limited to 'core')
-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 5cf42664a4..151298fc6a 100644 --- a/core/CronArchive.php +++ b/core/CronArchive.php @@ -453,9 +453,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; } @@ -473,7 +473,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 @@ -527,6 +527,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; |