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
diff options
context:
space:
mode:
authorThomas Steur <tsteur@users.noreply.github.com>2017-12-07 05:30:14 +0300
committerGitHub <noreply@github.com>2017-12-07 05:30:14 +0300
commitb743af045f73d390d96a58e29089f993b1cded33 (patch)
tree4b2bea383252b520df470ce9a73bd8cc9469d7bc
parente375ced813687f9f7438bbb0bda860eb60fea576 (diff)
Respect maintenance mode when archiving
-rw-r--r--core/CronArchive.php16
1 files changed, 16 insertions, 0 deletions
diff --git a/core/CronArchive.php b/core/CronArchive.php
index 4d82fab385..abd498f9d8 100644
--- a/core/CronArchive.php
+++ b/core/CronArchive.php
@@ -279,11 +279,21 @@ class CronArchive
$this->invalidator = StaticContainer::get('Piwik\Archive\ArchiveInvalidator');
}
+ private function isMaintenanceModeEnabled()
+ {
+ return Config::getInstance()->General['maintenance_mode'] == 1;
+ }
+
/**
* Initializes and runs the cron archiver.
*/
public function main()
{
+ if ($this->isMaintenanceModeEnabled() == 1) {
+ $this->logger->info("Archiving won't run because maintenance mode is enabled");
+ return;
+ }
+
$self = $this;
Access::doAsSuperUser(function () use ($self) {
$self->init();
@@ -356,6 +366,12 @@ class CronArchive
$this->logger->info("Starting Piwik reports archiving...");
do {
+
+ if ($this->isMaintenanceModeEnabled() == 1) {
+ $this->logger->info("Archiving will stop now because maintenance mode is enabled");
+ return;
+ }
+
$idSite = $this->websites->getNextSiteId();
if (null === $idSite) {