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
Conversation
|
||
private function getRememberedArchivedReportsOptionFromTracker($idSite, $dateStr) | ||
{ | ||
$cacheKey = self::TRACKER_CACHE_KEY; |
There was a problem hiding this comment.
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.
core/Archive/ArchiveInvalidator.php
Outdated
$suffix = substr($name, strlen($this->rememberArchivedReportIdStart)); | ||
list($idSite, $dateStr) = explode('_', $suffix); | ||
|
||
$all[$idSite][$dateStr][$name] = $value; |
There was a problem hiding this comment.
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
…matomo-org#15358) * Use tracker cache in ArchiveInvalidator so extra query is not needed. * apply review fixes * applied another feedback item
…matomo-org#15358) * Use tracker cache in ArchiveInvalidator so extra query is not needed. * apply review fixes * applied another feedback item
Fixes #15338