Skip to content

Commit

Permalink
fix bug in --force-periods logic
Browse files Browse the repository at this point in the history
refs #319
refs #5396
  • Loading branch information
mattab committed Jul 1, 2014
1 parent 0e00c39 commit 771220c
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions core/CronArchive.php
Original file line number Diff line number Diff line change
Expand Up @@ -377,10 +377,6 @@ private function archiveSingleSite($idSite, $requestsBefore)
$skipDayArchive = false;
}

if (!$this->shouldProcessPeriod("day")) {
$skipDayArchive = true;
}

if ($skipDayArchive) {
$this->log("Skipped website id $idSite, already done "
. \Piwik\MetricsFormatter::getPrettyTimeFromSeconds($elapsedSinceLastArchiving, true, $isHtml = false)
Expand Down Expand Up @@ -483,6 +479,11 @@ private function initSegmentsToArchive()
*/
protected function processArchiveDays($idSite, $lastTimestampWebsiteProcessedDay, $shouldArchivePeriods, Timer $timerWebsite)
{
if (!$this->shouldProcessPeriod("day")) {
// skip day archiving and proceed to period processing
return true;
}

// Fake that the request is already done, so that other core:archive commands
// running do not grab the same website from the queue
Option::set($this->lastRunKey($idSite, "day"), time());
Expand Down

0 comments on commit 771220c

Please sign in to comment.