Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Steur <tsteur@users.noreply.github.com>2019-10-02 06:05:36 +0300
committerGitHub <noreply@github.com>2019-10-02 06:05:36 +0300
commitd86ad317bbfc09ac48400a563915c7c25fb226cf (patch)
tree97affab9d63e4ff5c4816d47ac3f0f4576bb1e23 /core/Archive.php
parent378c403704552a88c6e01f955bc2379aaed8f172 (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.php9
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