(dev/core#174) systemStatusCheckResult - Migrate from settings to cache #12336
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
This is fundamentally an ephemeral value, and it's apt to being recalculated at arbitrary times. Storing this in the settings table limits the efficacy of read-only database.
See also: https://lab.civicrm.org/dev/core/issues/174
Before
Civi::settings()
.After
Civi::cache('checks')
.Technical Details
checks
cache may be stored in memory-based service, or in acivicrm_cache
SQL group, or in a static array. (It uses the best-available storage.)System.flush
akacv flush
akarebuildMenuAndCaches
-- which is done manually or as part of a system-lifecycle task, like installing new extensions)CRM_Core_Config::cleanupCaches()
(which can be triggered by the above -- or by major DB upgrade)CRM_Core_Config::clearDBCache()
(which can be triggered by the above -- or byJob.cleanup dbCache=1
,CRM/Utils/Migrate/Import*
, or the GUI page "Settings - Cleanup Caches and Update Paths", or any page based onCRM_Admin_Form_Setting
)Most of those seem like reasonable (and infrequent) occasions to clear it. I suppose
CRM_Admin_Form_Setting
is more debatable:If the last one is worth arguing over, then I assume someone will argue over it. ;)