Skip to content

Commit

Permalink
Refs #3405 Fixing build
Browse files Browse the repository at this point in the history
  • Loading branch information
mattab committed Oct 25, 2013
1 parent 0755e4c commit ea612f9
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions misc/cron/archive.php
Expand Up @@ -687,6 +687,9 @@ private function initStateFromParameters()
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
Expand All @@ -703,7 +706,7 @@ private function initStateFromParameters()
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;
}

Expand Down Expand Up @@ -827,7 +830,7 @@ private function addWebsiteIdsToReprocess($websitesIds)

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);
}
Expand All @@ -846,7 +849,7 @@ private function addWebsiteIdsWithVisitsSinceLastRun($timestampLastRun)
}
$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);
Expand Down Expand Up @@ -885,7 +888,7 @@ private function addWebsiteIdsInTimezoneWithNewDay($timezoneToProcess, $websiteI
$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);
}
Expand Down Expand Up @@ -973,7 +976,7 @@ private function getDelayBetweenPeriodsArchives()
*/
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;
Expand Down

0 comments on commit ea612f9

Please sign in to comment.