diff options
author | mattab <matthieu.aubry@gmail.com> | 2015-03-19 10:30:03 +0300 |
---|---|---|
committer | mattab <matthieu.aubry@gmail.com> | 2015-03-19 10:30:03 +0300 |
commit | 0dcd19441ffcc977c275f5d7823acf493f98a677 (patch) | |
tree | fa844128dad9e2ed35c604881a5718c28cdc8997 /core/CronArchive | |
parent | dfb9860120cf78e75444128296b175b5124030ad (diff) |
Make sure to pre-process in the past
Diffstat (limited to 'core/CronArchive')
-rw-r--r-- | core/CronArchive/SegmentArchivingRequestUrlProvider.php | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/core/CronArchive/SegmentArchivingRequestUrlProvider.php b/core/CronArchive/SegmentArchivingRequestUrlProvider.php index ddbaef0198..9dafd9f66e 100644 --- a/core/CronArchive/SegmentArchivingRequestUrlProvider.php +++ b/core/CronArchive/SegmentArchivingRequestUrlProvider.php @@ -64,8 +64,8 @@ class SegmentArchivingRequestUrlProvider // if the start date for the archiving request is before the minimum date allowed for processing this segment, // use the minimum allowed date as the start date $periodObj = PeriodFactory::build($period, $date); + $endDate = $periodObj->getDateEnd(); if ($periodObj->getDateStart()->getTimestamp() < $oldestDateToProcessForNewSegment->getTimestamp()) { - $endDate = $periodObj->getDateEnd(); // if the creation time of a segment is older than the end date of the archiving request range, we cannot // blindly rewrite the date string, since the resulting range would be incorrect. instead we make the @@ -74,8 +74,8 @@ class SegmentArchivingRequestUrlProvider $oldestDateToProcessForNewSegment = $endDate; } - $date = $oldestDateToProcessForNewSegment->toString().','.$endDate; } + $date = $oldestDateToProcessForNewSegment->toString().','.$endDate; return $date; } @@ -84,11 +84,10 @@ class SegmentArchivingRequestUrlProvider { if ($this->processNewSegmentsFrom == self::CREATION_TIME) { return $segmentCreatedTime; - } else if (preg_match("/^last([0-9]+)$/", $this->processNewSegmentsFrom, $matches)) { + } else if (preg_match("/^last([0-9]*)$/", $this->processNewSegmentsFrom, $matches)) { $lastN = $matches[1]; list($lastDate, $lastPeriod) = Range::getDateXPeriodsAgo($lastN, $segmentCreatedTime, 'day'); - return Date::factory($lastDate); } else { return null; |