Workflow is basically as follows:
For each archived report to remember we store an entry in the
option table. We make sure to create only one entry per
I removed the
invalidate_report call from log importer for now. In case something fails we should fix the actual bug in the core (Tracker or Archiver). In case we notice problems before the 2.10 release we can add the call temporarily again in log importer but only if there is actually an issue and only in case we cannot fix the issue quickly.
core:archiveand simply archives via browser, then the function
invalidateArchivedReportsForSitesThatNeedToBeArchivedAgainwill not be executed. this creates a different code path between
browser triggered archiving.
Besides this, looks nice!!
Different code paths is no good. So we'd have to invalidate the reports there https://github.com/piwik/piwik/blob/2.10.0-b9/core/Archive.php#L490 ? or somewhere else?
@tsteur I believe this is the best place to put it, yes! but it needs to be super fast as this function is called actually thousands and thousands of times when archiving. (called once for each blob and each set of numeric metrics!)
It is now done in
Archive::get(). It will actually invalidate max once per request. I added a test to make sure it is only done once and to make sure it actually works.
It will currently invalidate all "remembered invalid archives" in
Archive::get() which can take a while I reckon in case there are many many remembered invalid archives for many different sites. We could invalidate only for the sites that are actually requested but would make code more complex... I presume it is needed maybe?
Edit: I will push code soon that only invalidates archived reports for requested site ids for better performance