flowfuse
flowfuse copied to clipboard
Forge app only uses local cache of PlatformSettings data
Current Behavior
When using app.settings.foo = "bar"
the API updates the in memory cache then updates the database.
When reading from app.settings.foo
it only uses the in memory cache and doesn't refresh from the database.
This will break when we scale the forge app horizontally.
Expected Behavior
Reads from app.settings
need to either use a shared cache (redis) or pull from the database on a read.
Steps To Reproduce
Run 2 copies of the forge app with a shared db update admin settings valuses
Environment
- FlowFuse version: head/main
- Node.js version: 18.x
- npm version: 9.x
- Platform/OS: Kube/Linux
- Browser: NA
Have you provided an initial effort estimate for this issue?
I have provided an initial effort estimate
https://github.com/FlowFuse/flowfuse/blob/main/forge/settings/index.js#L35-L51
Generally speaking, reading these settings aren't on hot paths, so can afford to be a db lookup.