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
Allow different reports pre-archiving frequency for each period #11979
Conversation
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.
- We display in the core:archive output the settings values, could we also display the period values when they have been overwritten? (see
$this->logger->info("- Reports for today will be processed at most every " . $this->todayArchiveTimeToLive
)
Nice change!
time_before_month_archive_considered_outdated = -1 | ||
|
||
; Same as config setting "time_before_week_archive_considered_outdated" but it is only applied to yearly archives | ||
time_before_year_archive_considered_outdated = -1 |
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.
also should work to range
so let's add it maybe?
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.
👍
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. |
Would merge once tests are green |
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 #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.