Open hardillb opened 6 months ago
When using app.settings.foo = "bar" the API updates the in memory cache then updates the database.
app.settings.foo = "bar"
When reading from app.settings.foo it only uses the in memory cache and doesn't refresh from the database.
app.settings.foo
This will break when we scale the forge app horizontally.
Reads from app.settings need to either use a shared cache (redis) or pull from the database on a read.
app.settings
Run 2 copies of the forge app with a shared db update admin settings valuses
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.
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
Have you provided an initial effort estimate for this issue?
I have provided an initial effort estimate