diff options
author | mattab <matthieu.aubry@gmail.com> | 2013-10-25 06:14:19 +0400 |
---|---|---|
committer | mattab <matthieu.aubry@gmail.com> | 2013-10-25 06:14:19 +0400 |
commit | ea612f9fad44a76429b6972d1a29043f42eae09a (patch) | |
tree | 1ea9fbd86561ecf76d9cd45815afa40b50a50948 /misc/cron | |
parent | 0755e4c0ec63f62f41d5d22efef7c127378546fb (diff) |
Refs #3405 Fixing build
Diffstat (limited to 'misc/cron')
-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 30ac1e9019..0cefb988eb 100644 --- a/misc/cron/archive.php +++ b/misc/cron/archive.php @@ -687,6 +687,9 @@ class CronArchive if (!empty($this->lastSuccessRunTimestamp)) { // there was a previous successful run $this->shouldArchiveOnlySitesWithTrafficSince = time() - $this->lastSuccessRunTimestamp; + } else { + // First time we run the script + $this->shouldArchiveOnlySitesWithTrafficSince = self::ARCHIVE_SITES_WITH_TRAFFIC_SINCE; } } else { // force-all-periods is set here @@ -703,7 +706,7 @@ class CronArchive private function initWebsitesToProcess() { if ($this->shouldArchiveAllSites) { - $this->log("Will process all " . count($this->allWebsites) . " websites"); + $this->log("- Will process all " . count($this->allWebsites) . " websites"); return $this->allWebsites; } @@ -827,7 +830,7 @@ class CronArchive if (count($this->idSitesInvalidatedOldReports) > 0) { $ids = ", IDs: " . implode(", ", $this->idSitesInvalidatedOldReports); - $this->log("Will process " . count($this->idSitesInvalidatedOldReports) + $this->log("- Will process " . count($this->idSitesInvalidatedOldReports) . " other websites because some old data reports have been invalidated (eg. using the Log Import script) " . $ids); } @@ -846,7 +849,7 @@ class CronArchive } $websiteIds = !empty($sitesIdWithVisits) ? ", IDs: " . implode(", ", $sitesIdWithVisits) : ""; $prettySeconds = \Piwik\MetricsFormatter::getPrettyTimeFromSeconds( time() - $timestampLastRun, true, false); - $this->log("Will process " . count($sitesIdWithVisits) . " websites with new visits since " + $this->log("- Will process " . count($sitesIdWithVisits) . " websites with new visits since " . $prettySeconds . " " . $websiteIds); @@ -885,7 +888,7 @@ class CronArchive $this->websiteDayHasFinishedSinceLastRun = $websiteDayHasFinishedSinceLastRun; if (count($websiteDayHasFinishedSinceLastRun) > 0) { $ids = !empty($websiteDayHasFinishedSinceLastRun) ? ", IDs: " . implode(", ", $websiteDayHasFinishedSinceLastRun) : ""; - $this->log("Will process " . count($websiteDayHasFinishedSinceLastRun) + $this->log("- Will process " . count($websiteDayHasFinishedSinceLastRun) . " other websites because the last time they were archived was on a different day (in the website's timezone) " . $ids); } @@ -973,7 +976,7 @@ class CronArchive */ private function getTimestampLastRun() { - $this->log("- we will process websites with visits in the last " + $this->log("- Will process websites with visits in the last " . \Piwik\MetricsFormatter::getPrettyTimeFromSeconds($this->shouldArchiveOnlySitesWithTrafficSince, true, false) ); return time() - $this->shouldArchiveOnlySitesWithTrafficSince; |