diff options
author | matt <matt@59fd770c-687e-43c8-a1e3-f5a4ff64c105> | 2010-06-23 07:45:36 +0400 |
---|---|---|
committer | matt <matt@59fd770c-687e-43c8-a1e3-f5a4ff64c105> | 2010-06-23 07:45:36 +0400 |
commit | 7e1b5d6b762340cbff1bb928d15815980c7649a7 (patch) | |
tree | e07da179b9e1372866d2349777bd1cc6b4c9e8cf /core/Archive/Single.php | |
parent | 999f46479294713104c962bfe7469e9b6e7a4bbf (diff) | |
parent | c98ea06f2cccec81c6ccce49162a583494e44d91 (diff) |
Diffstat (limited to 'core/Archive/Single.php')
-rw-r--r-- | core/Archive/Single.php | 24 |
1 files changed, 17 insertions, 7 deletions
diff --git a/core/Archive/Single.php b/core/Archive/Single.php index 464ecf7f31..991ecd7a67 100644 --- a/core/Archive/Single.php +++ b/core/Archive/Single.php @@ -134,9 +134,12 @@ class Piwik_Archive_Single extends Piwik_Archive { if(!is_null($this->archiveProcessing)) { - return $this->archiveProcessing->getTimestampStartDate(); + $timestamp = $this->archiveProcessing->getTimestampStartDate(); + if(!empty($timestamp)) + { + return $timestamp; + } } - return $this->period->getDateStart()->getTimestamp(); } @@ -152,18 +155,20 @@ class Piwik_Archive_Single extends Piwik_Archive { $this->isThereSomeVisits = false; $this->alreadyChecked = true; - + $logMessage = "Preparing archive: "; // if the END of the period is BEFORE the website creation date // we already know there are no stats for this period // we add one day to make sure we don't miss the day of the website creation if( $this->period->getDateEnd()->addDay(2)->isEarlier( $this->site->getCreationDate() ) ) { - return; + Piwik::log("$logMessage skipped, archive is before the website was created."); + return; } // if the starting date is in the future we know there is no visit - if( $this->period->getDateStart()->subDay(1)->isLater( Piwik_Date::today() ) ) + if( $this->period->getDateStart()->subDay(2)->isLater( Piwik_Date::today() ) ) { + Piwik::log("$logMessage skipped, archive is after today."); return; } @@ -173,12 +178,17 @@ class Piwik_Archive_Single extends Piwik_Archive $archiveProcessing->setSite($this->site); $archiveProcessing->setPeriod($this->period); $idArchive = $archiveProcessing->loadArchive(); - if($idArchive === null) + if(empty($idArchive)) { + Piwik::log("$logMessage not archived yet, starting processing..."); $archiveJustProcessed = true; $archiveProcessing->launchArchiving(); $idArchive = $archiveProcessing->getIdArchive(); } + else + { + Piwik::log("$logMessage archive already processed [id = $idArchive]..."); + } $this->isThereSomeVisits = $archiveProcessing->isThereSomeVisits; $this->idArchive = $idArchive; $this->archiveProcessing = $archiveProcessing; @@ -442,7 +452,7 @@ class Piwik_Archive_Single extends Piwik_Archive if($data === false && $idSubTable !== null) { - throw new Exception("You are requesting a precise subTable but there is not such data in the Archive."); + throw new Exception(Piwik_TranslateException('General_ExceptionSubtableNotFoundInArchive')); } return $table; |