diff options
author | diosmosis <diosmosis@users.noreply.github.com> | 2021-02-02 04:33:54 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-02-02 04:33:54 +0300 |
commit | 41ca1a79e702a3330299db6d6552b81ed77c4f23 (patch) | |
tree | 71bd3481c0554729190840a6a4aba70d55a845a4 /core | |
parent | 25a2da15d49e0a5170e844cefacea7d6bdd49837 (diff) |
Allow filtering for invalidations for specific reports in core:archive (mostly for automation purposes). (#16991)
Diffstat (limited to 'core')
-rw-r--r-- | core/CronArchive/ArchiveFilter.php | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/core/CronArchive/ArchiveFilter.php b/core/CronArchive/ArchiveFilter.php index 7789ed556b..c3686aaa59 100644 --- a/core/CronArchive/ArchiveFilter.php +++ b/core/CronArchive/ArchiveFilter.php @@ -53,6 +53,13 @@ class ArchiveFilter */ private $skipSegmentsForToday = false; + /** + * If enabled, the only invalidations that will be processed are for the specific plugin and report specified + * here. Must be in the format "MyPlugin.myReport". + * @var string|null + */ + private $forceReport = null; + public function __construct() { $this->setRestrictToPeriods(''); @@ -102,6 +109,14 @@ class ArchiveFilter return "period is not specified in --force-periods"; } + if (!empty($this->forceReport) + && (empty($archive['plugin']) + || empty($archive['report']) + || $archive['plugin'] . '.' . $archive['report'] != $this->forceReport) + ) { + return "report is not the same as value specified in --force-report"; + } + return false; } @@ -224,6 +239,11 @@ class ArchiveFilter return $this->skipSegmentsForToday; } + public function setForceReport($forceReport) + { + $this->forceReport = $forceReport; + } + /** * @return array */ |