diff options
author | mattab <matthieu.aubry@gmail.com> | 2014-11-05 08:55:07 +0300 |
---|---|---|
committer | mattab <matthieu.aubry@gmail.com> | 2014-11-05 08:55:07 +0300 |
commit | 07dabe2400626c6855dcf5b3d4f390125f0b6e30 (patch) | |
tree | 8d4f6f849580a92ae8171f6f50e5ec3b22a88539 /core/CronArchive.php | |
parent | 8c4ab6d1ef5a683f749d97dcaa26a6e2ce65df12 (diff) |
fixes #6598 Add sites to be invalidated when the archiving failed to make sure we try to reprocess again later
Diffstat (limited to 'core/CronArchive.php')
-rw-r--r-- | core/CronArchive.php | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/core/CronArchive.php b/core/CronArchive.php index 64fee8ba05..5cf42664a4 100644 --- a/core/CronArchive.php +++ b/core/CronArchive.php @@ -604,8 +604,8 @@ class CronArchive // Remove this website from the list of websites to be invalidated // since it's now just about to being re-processed, makes sure another running cron archiving process // does not archive the same idSite - if ($this->isOldReportInvalidatedForWebsite($idSite)) { - + $websiteInvalidatedShouldReprocess = $this->isOldReportInvalidatedForWebsite($idSite); + if ($websiteInvalidatedShouldReprocess) { $store = new InvalidatedReports(); $store->storeSiteIsReprocessed($idSite); } @@ -613,7 +613,7 @@ class CronArchive // when some data was purged from this website // we make sure we query all previous days/weeks/months $processDaysSince = $lastTimestampWebsiteProcessedDay; - if ($this->isOldReportInvalidatedForWebsite($idSite) + if ($websiteInvalidatedShouldReprocess // when --force-all-websites option, // also forces to archive last52 days to be safe || $this->shouldArchiveAllSites) { @@ -632,6 +632,12 @@ class CronArchive // cancel the succesful run flag Option::set($this->lastRunKey($idSite, "day"), 0); + // cancel marking the site as reprocessed + if($websiteInvalidatedShouldReprocess) { + $store = new InvalidatedReports(); + $store->addInvalidatedSitesToReprocess(array($idSite)); + } + $this->logError("Empty or invalid response '$content' for website id $idSite, " . $timerWebsite->__toString() . ", skipping"); $this->skipped++; return false; |