Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use tracker cache in ArchiveInvalidator so extra query is not needed. #15358

Merged
merged 3 commits into from Jan 8, 2020

Conversation

diosmosis
Copy link
Member

Fixes #15338

@diosmosis diosmosis added not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org. Needs Review PRs that need a code review labels Jan 8, 2020
@diosmosis diosmosis added this to the 3.13.1 milestone Jan 8, 2020

private function getRememberedArchivedReportsOptionFromTracker($idSite, $dateStr)
{
$cacheKey = self::TRACKER_CACHE_KEY;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ideally, it would check whether we are in tracker mode and then read it from cache, or otherwise use the result directly. Otherwise we have to basically launch Matomo in tracker mode during a regular request. Seems to be eg used in DataSubjects which is not a tracking request.

$suffix = substr($name, strlen($this->rememberArchivedReportIdStart));
list($idSite, $dateStr) = explode('_', $suffix);

$all[$idSite][$dateStr][$name] = $value;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably not too important but [$name] could be removed? It doesn't look at this one in the cached tracker value and it would also prevent that when 200 tracking requests at the same time use the option::set that we have 200 keys in there for the same idSite,dateStr combination

@tsteur tsteur merged commit 18b0815 into 3.x-dev Jan 8, 2020
@tsteur tsteur deleted the 15338-invalidator-tracker-cache branch January 8, 2020 06:11
jonasgrilleres pushed a commit to 1024pix/pix-analytics that referenced this pull request Sep 22, 2020
…matomo-org#15358)

* Use tracker cache in ArchiveInvalidator so extra query is not needed.

* apply review fixes

* applied another feedback item
jbuget pushed a commit to 1024pix/pix-analytics that referenced this pull request Sep 26, 2020
…matomo-org#15358)

* Use tracker cache in ArchiveInvalidator so extra query is not needed.

* apply review fixes

* applied another feedback item
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Needs Review PRs that need a code review not-in-changelog For issues or pull requests that should not be included in our release changelog on matomo.org.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Additional options query per tracking request
2 participants