diff options
author | mattab <matthieu.aubry@gmail.com> | 2013-06-12 08:23:51 +0400 |
---|---|---|
committer | mattab <matthieu.aubry@gmail.com> | 2013-06-16 12:11:03 +0400 |
commit | d8f110aca03ff8c73811a141631f12a7a1ddc16f (patch) | |
tree | 58ca855357d521bae098e882970a14c83874b742 /misc | |
parent | c17139710a43b55b5f48377e6281db6ae602957c (diff) |
More refactoring, moving SQL to classes and cleaning up logic so I can understand it (nearly there)
Diffstat (limited to 'misc')
-rw-r--r-- | misc/cron/archive.php | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/misc/cron/archive.php b/misc/cron/archive.php index 88c7b1924f..6d1d514a85 100644 --- a/misc/cron/archive.php +++ b/misc/cron/archive.php @@ -125,8 +125,8 @@ class Archiving $this->log("Notes"); // Information about timeout - $this->todayArchiveTimeToLive = Piwik_ArchiveProcessing::getTodayArchiveTimeToLive(); - $this->log("- Reports for today will be processed at most every " . Piwik_ArchiveProcessing::getTodayArchiveTimeToLive() + $this->todayArchiveTimeToLive = Piwik_ArchiveProcessor_Rules::getTodayArchiveTimeToLive(); + $this->log("- Reports for today will be processed at most every " . $this->todayArchiveTimeToLive . " seconds. You can change this value in Piwik UI > Settings > General Settings."); $this->log("- Reports for the current week/month/year will be refreshed at most every " . $this->processPeriodsMaximumEverySeconds . " seconds."); @@ -272,11 +272,14 @@ class Archiving continue; } $visitsToday = end($response); + if(empty($visitsToday)) { + $visitsToday = 0; + } $this->requests++; $processed++; // If there is no visit today and we don't need to process this website, we can skip remaining archives - if ($visitsToday <= 0 + if ($visitsToday == 0 && !$shouldArchivePeriods ) { $this->log("Skipped website id $idsite, no visit today, " . $timerWebsite->__toString()); @@ -667,7 +670,7 @@ class Archiving ) // in case --force-timeout-for-periods= without [seconds] specified { // Ensure the cache for periods is at least as high as cache for today - $todayTTL = Piwik_ArchiveProcessing::getTodayArchiveTimeToLive(); + $todayTTL = Piwik_ArchiveProcessor_Rules::getTodayArchiveTimeToLive(); if ($forceTimeoutPeriod < $todayTTL) { $this->log("WARNING: Automatically increasing --force-timeout-for-periods from $forceTimeoutPeriod to " . $todayTTL @@ -678,7 +681,7 @@ class Archiving } // Recommend to disable browser archiving when using this script - if (Piwik_ArchiveProcessing::isBrowserTriggerArchivingEnabled()) { + if (Piwik_ArchiveProcessor_Rules::isBrowserTriggerEnabled()) { $this->log("NOTE: if you execute this script at least once per hour (or more often) in a crontab, you may disable 'Browser trigger archiving' in Piwik UI > Settings > General Settings. "); $this->log(" see doc at: http://piwik.org/docs/setup-auto-archiving/"); } |