Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorpaladox <paladox@users.noreply.github.com>2019-05-03 00:10:48 +0300
committerThomas Steur <tsteur@users.noreply.github.com>2019-05-03 00:10:48 +0300
commitc9f70ee230fc2ae367718b305483fea3c673dab8 (patch)
tree171248a2c66aad990c3b1dceb3cb5a8d517ddb44 /core
parent3492c37659ff9d5368d8b43827466e0edae6f392 (diff)
CronArchive: Catch UnexpectedWebsiteFoundException (#14403)
* CronArchive: Catch UnexpectedWebsiteFoundException This is to allow the archive to continue if the site was deleted from matomo. Fixes #14393 * Update CronArchive.php
Diffstat (limited to 'core')
-rw-r--r--core/CronArchive.php33
1 files changed, 22 insertions, 11 deletions
diff --git a/core/CronArchive.php b/core/CronArchive.php
index 49df8bab61..706dd4c5c6 100644
--- a/core/CronArchive.php
+++ b/core/CronArchive.php
@@ -459,17 +459,22 @@ class CronArchive
// to process the archives for this website (only if there were visits since midnight)
if (!$hasWebsiteDayFinishedSinceLastRun && !$isOldReportInvalidatedForWebsite) {
- if ($this->isWebsiteUsingTheTracker($idSite)) {
-
- if(!$this->hadWebsiteTrafficSinceMidnightInTimezone($idSite)) {
- $this->logger->info("Skipped website id $idSite as archiving is not needed");
-
- $this->skippedDayNoRecentData++;
- $this->skipped++;
- continue;
+ try {
+ if ($this->isWebsiteUsingTheTracker($idSite)) {
+
+ if(!$this->hadWebsiteTrafficSinceMidnightInTimezone($idSite)) {
+ $this->logger->info("Skipped website id $idSite as archiving is not needed");
+
+ $this->skippedDayNoRecentData++;
+ $this->skipped++;
+ continue;
+ }
+ } else {
+ $this->logger->info("- website id $idSite is not using the tracker");
}
- } else {
- $this->logger->info("- website id $idSite is not using the tracker");
+ } catch (UnexpectedWebsiteFoundException $e) {
+ $this->logger->info("Skipped website id $idSite, got: UnexpectedWebsiteFoundException");
+ continue;
}
} elseif ($hasWebsiteDayFinishedSinceLastRun) {
@@ -716,7 +721,13 @@ class CronArchive
/**
* Trigger archiving for non-day periods
*/
- $success = $this->processArchiveForPeriods($idSite, $lastTimestampWebsiteProcessedPeriods);
+ try {
+ $success = $this->processArchiveForPeriods($idSite, $lastTimestampWebsiteProcessedPeriods);
+ } catch (UnexpectedWebsiteFoundException $e) {
+ // this website was deleted in the meantime
+ $this->logger->info("Skipped website id $idSite, got: UnexpectedWebsiteFoundException, " . $timerWebsite->__toString());
+ return false;
+ }
// Record successful run of this website's periods archiving
if ($success) {