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
archiving: look for all usable done flag types when checking for existing child periods #17304
Conversation
@@ -847,9 +847,10 @@ public function hasChildArchivesInPeriod($idSite, Period $period) | |||
while ($date->isEarlier($period->getDateEnd()->addPeriod(1, 'month'))) { | |||
$archiveTable = ArchiveTableCreator::getNumericTable($date); | |||
|
|||
$usableDoneFlags = [ArchiveWriter::DONE_OK, ArchiveWriter::DONE_INVALIDATED, ArchiveWriter::DONE_PARTIAL, ArchiveWriter::DONE_OK_TEMPORARY]; |
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.
Using partial or temporary archives kind of makes sense for me, but why are we also using invalidated archives here?
Shouldn't the archiving be triggered for invalidated archives, that can be used then?
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.
@sgiehl they should normally be rearchived before this archive gets launched (ie, weeks before months), but in the specific case of the GoogleAnalyticsImporter they don't have to be, since the plugin does not allow rearchiving of days w/ imported data (to make sure the imported data doesn't disappear through user or programming error). So in this case the days that are invalidated get ignored. It might be a better solution in the future to disallow invalidating them entirely...
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.
Might be good to add a small comment above the line then, so it's clear why we also use invalidated archives here. Just to prevent we remove it later by accident.
@diosmosis besides adding a comment to explain the behavior a bit, this one looks good to merge |
Description:
When checking for child periods we can use when archiving there might be invalidated archives that could be used which we should also detect. This mostly affects sites that use the tracker and can have no visits, but day archives with data, and no other higher archives. To my knowledge this just includes sites imported from google.
Review