Skip to content
Extraits de code Groupes Projets
Non vérifiée Valider b743af04 rédigé par Thomas Steur's avatar Thomas Steur Validation de GitHub
Parcourir les fichiers

Respect maintenance mode when archiving

parent e375ced8
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
......@@ -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) {
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter