Skip to content
Extraits de code Groupes Projets
Valider 6c1edbe2 rédigé par mattab's avatar mattab
Parcourir les fichiers

refactor

parent 44ff74c2
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -265,10 +265,7 @@ class Piwik_Tracker ...@@ -265,10 +265,7 @@ class Piwik_Tracker
// run scheduled task // run scheduled task
try try
{ {
// don't run scheduled tasks in CLI mode from Tracker, this is the case if($this->shouldRunScheduledTasks())
// where we bulk load logs & don't want to lose time with tasks
if(!Piwik_Common::isPhpCliMode()
&& !$this->authenticated && $this->getState() != self::STATE_LOGGING_DISABLE)
{ {
self::runScheduledTasks($now = $this->getCurrentTimestamp()); self::runScheduledTasks($now = $this->getCurrentTimestamp());
} }
...@@ -281,6 +278,15 @@ class Piwik_Tracker ...@@ -281,6 +278,15 @@ class Piwik_Tracker
$this->end(); $this->end();
} }
protected function shouldRunScheduledTasks()
{
// don't run scheduled tasks in CLI mode from Tracker, this is the case
// where we bulk load logs & don't want to lose time with tasks
return !Piwik_Common::isPhpCliMode()
&& !$this->authenticated
&& $this->getState() != self::STATE_LOGGING_DISABLE;
}
/** /**
* Tracker requests will automatically trigger the Scheduled tasks. * Tracker requests will automatically trigger the Scheduled tasks.
* This is useful for users who don't setup the cron, * This is useful for users who don't setup the cron,
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Veuillez vous inscrire ou vous pour commenter