diff --git a/core/CronArchive.php b/core/CronArchive.php index ba0b1632203843223ce342a8f305b505b890ffd8..6828519ad1c20c3cabc6a722fc6116879cb4cd92 100644 --- a/core/CronArchive.php +++ b/core/CronArchive.php @@ -612,13 +612,16 @@ class CronArchive $success = $periodArchiveWasSuccessful && $success; } - // period=range - $customDateRangesToPreProcessForSite = $this->getCustomDateRangeToPreProcess($idSite); - foreach ($customDateRangesToPreProcessForSite as $dateRange) { - $archiveSegments = false; // do not pre-process segments for period=range #7611 - $periodArchiveWasSuccessful = $this->archiveReportsFor($idSite, 'range', $dateRange, $archiveSegments); - $success = $periodArchiveWasSuccessful && $success; + if ($this->shouldProcessPeriod('range')) { + // period=range + $customDateRangesToPreProcessForSite = $this->getCustomDateRangeToPreProcess($idSite); + foreach ($customDateRangesToPreProcessForSite as $dateRange) { + $archiveSegments = false; // do not pre-process segments for period=range #7611 + $periodArchiveWasSuccessful = $this->archiveReportsFor($idSite, 'range', $dateRange, $archiveSegments); + $success = $periodArchiveWasSuccessful && $success; + } } + return $success; } @@ -1285,7 +1288,7 @@ class CronArchive */ private function getDefaultPeriodsToProcess() { - return array('day', 'week', 'month', 'year'); + return array('day', 'week', 'month', 'year', 'range'); } /** diff --git a/plugins/CoreConsole/Commands/CoreArchiver.php b/plugins/CoreConsole/Commands/CoreArchiver.php index 40fc7d4c71f2cd183d1e431b2213af7a545e8091..7f1eb6107d2f590124c3d3bf37f2eb818c84075a 100644 --- a/plugins/CoreConsole/Commands/CoreArchiver.php +++ b/plugins/CoreConsole/Commands/CoreArchiver.php @@ -100,7 +100,7 @@ class CoreArchiver extends ConsoleCommand $command->addOption('force-idsites', null, InputOption::VALUE_OPTIONAL, 'If specified, archiving will be processed only for these Sites Ids (comma separated)'); $command->addOption('force-periods', null, InputOption::VALUE_OPTIONAL, - "If specified, archiving will be processed only for these Periods (comma separated eg. day,week,month)"); + "If specified, archiving will be processed only for these Periods (comma separated eg. day,week,month,year,range)"); $command->addOption('force-date-last-n', null, InputOption::VALUE_REQUIRED, "This script calls the API with period=lastN. You can force the N in lastN by specifying this value."); $command->addOption('force-date-range', null, InputOption::VALUE_OPTIONAL,