@tsteur opened this Issue on October 20th 2020 Member

@diosmosis I'm thinking there may be an issue around invalidation.

When executing eg CoreAdminHomeApi::getInstance()->invalidateArchivedReports($idsite =1, 'today', 'day', false, false); then it generates 4 entries in the archive invalidations table:
image

When I then run the CLI archiver, it only processes the first archive for the day. All other ones are ignored in usableArchiveExists because it found a usable archive for these periods.

image

This archive is invalidated though
image

and therefore it should reprocess the archive and not consider it as usable as such AFAIK.

In this case the invalidation was specifically requested and therefore it has to be reprocessed. FYI In my case in Matomo for WordPress I have these TTLs configured:

time_before_today_archive_considered_outdated = 1800
time_before_week_archive_considered_outdated = 3500
time_before_month_archive_considered_outdated = 7100
time_before_year_archive_considered_outdated = 14300
time_before_range_archive_considered_outdated = 3600

It is different when:

  • User tracks data for today
  • Thus Matomo stores a record to remember to invalidate a report
  • But an existing archive should actually only be invalidated after the configured TTL.
  • After the configured ttl of say 1800s after the report was archived last then it should actually invalidate the report
  • And then it should rearchive the report.

This I think works already.

@diosmosis commented on October 26th 2020 Member

I'm currently testing this, but I noticed 'today'/'yesterday'/'now' etc. aren't allowed in CoreAdminHomeApi::getInstance()->invalidateArchivedReports() because of https://github.com/matomo-org/matomo/blob/4.x-dev/plugins/CoreAdminHome/API.php#L329. Just an FYI, will change in a PR.

@tsteur commented on October 26th 2020 Member

👍 I'm using today's date string in https://github.com/matomo-org/wp-matomo/blob/1.3.1/classes/WpMatomo/Admin/SystemReport.php#L95-L100 was more like to clarify that I'm using today's date

This Issue was closed on October 28th 2020
Powered by GitHub Issue Mirror