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
Fix archiving when getmypid is disabled #15330
Conversation
@@ -130,7 +132,11 @@ private function buildRememberArchivedReportIdForSiteAndDate($idSite, $date) | |||
private function buildRememberArchivedReportIdProcessSafe($idSite, $date) | |||
{ | |||
$id = $this->buildRememberArchivedReportIdForSiteAndDate($idSite, $date); | |||
$id .= '_' . getmypid(); | |||
if (Process::isMethodDisabled('getmypid')) { | |||
$id .= '_' . Common::getRandomString(); |
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.
Should we cache the value of Common::getRandomString()
so the same value gets used next time (to simulate a real PID)?
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.
@diosmosis this method should be executed max once per request as the next time the option is set... could even always use getRandomInt in theory
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.
I see, makes sense 👍 will merge
* Fix archiving when getmypid is disabled * Update ArchiveInvalidator.php * Update ArchiveInvalidator.php
* Fix archiving when getmypid is disabled * Update ArchiveInvalidator.php * Update ArchiveInvalidator.php
See matomo-org/matomo-for-wordpress#163 (comment)
Seems this fixes some PHP bug or so. More explanation in above link