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:
authordiosmosis <diosmosis@users.noreply.github.com>2020-11-18 23:04:51 +0300
committerGitHub <noreply@github.com>2020-11-18 23:04:51 +0300
commite2f49032a4bd1c38f32e05c7450f7179117c18d9 (patch)
treed218d8ac73e1a35b4ce178b25ebfc812d43ccb93 /core
parent74271243d13327696fa252179ba555f31a4b1510 (diff)
add check for dangling invalidations (#16739)
Diffstat (limited to 'core')
-rw-r--r--core/CronArchive.php24
1 files changed, 24 insertions, 0 deletions
diff --git a/core/CronArchive.php b/core/CronArchive.php
index 2e39499685..df98bd3274 100644
--- a/core/CronArchive.php
+++ b/core/CronArchive.php
@@ -489,6 +489,9 @@ class CronArchive
$this->requests += count($urls);
+ $idInvalidations = array_column($archives, 'idinvalidation');
+ $this->checkNoDanglingInvalidations($idInvalidations);
+
return $successCount;
}
@@ -1234,4 +1237,25 @@ class CronArchive
return new SharedSiteIds($websitesIds, SharedSiteIds::OPTION_ALL_WEBSITES);
}
+
+ /**
+ * @deprecaed
+ */
+ public function checkNoDanglingInvalidations(array $idInvalidations)
+ {
+ $table = Common::prefixTable('archive_invalidations');
+ $idInvalidations = array_map('intval', $idInvalidations);
+
+ $sql = "SELECT idinvalidation FROM `$table` WHERE idinvalidation IN (" . implode(',', $idInvalidations) . ") AND status = "
+ . ArchiveInvalidator::INVALIDATION_STATUS_IN_PROGRESS;
+
+ $inProgress = Db::fetchAll($sql);
+ $inProgress = array_column($inProgress, 'idinvalidation');
+
+ if (!empty($inProgress)) {
+ $this->logger->error("Found dangling invalidations that were not correctly reset or removed, this should be reported on the forums: {invalidations}", [
+ 'idinvalidations' => json_encode($inProgress),
+ ]);
+ }
+ }
}