-
Notifications
You must be signed in to change notification settings - Fork 196
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
FOUR-6601: Refactor settings #4479
Conversation
afb7f13
to
de88b05
Compare
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.
For saved search I just did a test, and it seems the settings still cached, please watch the following video @runyan-co
Screen.Recording.2022-08-19.at.10.18.42.mov
To make the changes take effect you need to restart horizon manually:
Screen.Recording.2022-08-19.at.10.22.26.mov
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.
Extended properties configuration working correctly:
Screen.Recording.2022-08-19.at.10.37.29.mov
SSO configuration working correctly:
Screen.Recording.2022-08-19.at.10.55.04.mov
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.
Horizon is terminating constantly after trying to run a process with data connector:
Screen.Recording.2022-08-19.at.10.57.11.mov
Screen.Recording.2022-08-19.at.10.59.41.mov
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.
ABE seems to be working correctly:
Screen.Recording.2022-08-19.at.12.54.28.mov
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.
SCIM settings working correctly:
Screen.Recording.2022-08-19.at.16.32.57.mov
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.
SAML settings working correctly:
Screen.Recording.2022-08-19.at.16.58.15.mov
…oved unneeded argument for refresh_artisan_caches()
Hey @agustinbusso, I reviewed your screen recording and it looks like it's working correctly. Since you're running horizon in the foreground (using If you're interested, I included the supervisor config file I use in my local environment. You'd need to change out the path to artisan in the file and then add the file to the supervisor config directory:
|
Saved search send email report working correctly Screen.Recording.2022-08-24.at.10.52.27.mov |
Send email from connector working correctly: Screen.Recording.2022-08-24.at.11.17.06.mov |
Docusign settings changing correctly: Screen.Recording.2022-08-24.at.11.34.45.mov |
Test for FOUR-6599: Working well, settings are not cached: Screen.Recording.2022-08-24.at.15.29.33.movScreen.Recording.2022-08-24.at.15.27.55.mov |
Check list: |
Environment Setup
Issue & Reproduction Steps
We used to utilize a tagged Redis cache to store settings to reduce the number of queries to the database every time the app is loaded. Over time, we've noticed the cache actually creates too many network calls to Redis (it makes a network call everytime a cached setting is called) and it uses a lot more memory by each PHP process. We also had a
settings()
function helper which complicates things as all settings were also in the global app config (accessed using theconfig()
function helper).This PR refactors the settings so they can be easily accessed through the global app configuration. This will reduce the duplicative nature of the
settings()
helper and simplify the app config caching process.Solution
The
SettingsServiceProvider
loads all settings from the database and binds the key and config values into the app’s global configuration. If the app configuration is cached when a setting is saved or updated, the config will automatically be cleared and re-cached. Horizon will also be restarted when the configuration is re-cached to ensure it picks up the updated config values.Refactoring settings usage in packages
Multiple packages implement and use settings, however this refactor deprecates the
settings()
,flush_settings()
, and thecache_settings()
function helpers. There are also other changes which need to be made to specific place in the below packages to ensure the settings are correctly implemented.How to Test
Extensive testing will be required to ensure all PRs cover all use cases of settings, ensuring they are updated (even when the configuration is cached).
Related Tickets & Packages
Code Review Checklist