diff options
author | Thomas Steur <tsteur@users.noreply.github.com> | 2019-10-02 06:05:36 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-02 06:05:36 +0300 |
commit | d86ad317bbfc09ac48400a563915c7c25fb226cf (patch) | |
tree | 97affab9d63e4ff5c4816d47ac3f0f4576bb1e23 /core/Archive.php | |
parent | 378c403704552a88c6e01f955bc2379aaed8f172 (diff) |
Add option to archiver to not create archives for segments for today (#14834)
* add option to not archive segment for today
* better implementation
* added some logging and tests
* also archive when ts_last_edit is recent
* tweak message
Diffstat (limited to 'core/Archive.php')
-rw-r--r-- | core/Archive.php | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/core/Archive.php b/core/Archive.php index 7aaebee856..3bf6d5b187 100644 --- a/core/Archive.php +++ b/core/Archive.php @@ -649,6 +649,15 @@ class Archive implements ArchiveQuery foreach ($this->params->getIdSites() as $idSite) { $site = new Site($idSite); + if ($period->getLabel() === 'day' + && !$this->params->getSegment()->isEmpty() + && Common::getRequestVar('skipArchiveSegmentToday', 0, 'int') + && $period->getDateStart()->toString() == Date::factory('now', $site->getTimezone())->toString()) { + + Log::debug("Skipping archive %s for %s as segment today is disabled", $period->getLabel(), $period->getPrettyString()); + continue; + } + // 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 |