@tsteur opened this Pull Request on August 28th 2017 Member

refs #11965

Added new config setting time_before_$period_archive_considered_outdated = -1 to allow configuration of archive frequency per period. By default, nothing changes and it falls back to regular UI setting (or config setting for today).

If value is configured and set to > 0, the value for that period will be applied.

We could be smart and eg if today is set to 600, but weekly is set to 300, then we would still use 600 as there "shouldn't" be any updated version but it would be tricky to hard code this in there. Also the config name is generated generic based on "periodLabel" as several people are adding new features to allow new periods.

When using cron archive, it may still send an archive request for a period but it shouldn't actually archive it. A simple test would be to do a full archive. Then set the setting for week period eg to 6000 and you will notice the weekly archive will be finished in a second. Then change setting back to "1" and you will notice it will re-archive the weekly archive.

If setting name and behaviour is fine, we will need to add it to developer changelog and maybe also consider another PR on top of this and https://github.com/piwik/piwik/pull/11972 (once #11972 is merged) to possibly allow archives that are even older than 12 hours if the period archives are supposed to be only archived eg every 24 hours.

There are no tests right now as there are no tests in general for the Rules class. Can add one though.

@mattab any thoughts? Be nice to have this in 3.1.0 already.

@tsteur commented on August 28th 2017 Member

Printing the values now if they are customized. It still shows below always

"Reports for the current week/month/year will be refreshed at most every 3600 seconds." since the min archive time check is done when trying to archive and not in CronArchive itself.

@mattab commented on September 1st 2017 Member

Would merge once tests are green

This Pull Request was closed on September 4th 2017
Powered by GitHub Issue Mirror