Files
discourse/app/models
Martin Brennan 470b2891c5 FIX: Theme site settings not reloading across processes (#34242)
This commit fixes an issue in multi-process setups where the following
would happen:

1. Admin changes a theme site setting. The new value is stored in memory
   in the process that made the change. For this example, changing
   `enable_welcome_banner` from `true` to `false`
2. Another user visits the site and hits another process, which has the
   old value of `enable_welcome_banner` still set to `true` in memory
3. The other user's value for `enable_welcome_banner` is cached in
   the cache for theme site settings, which is shared across all
   processes

The issue is fixed by doing the same thing as site settings: when the
new value is saved, we send a MessageBus message to all processes via
`SiteSettingExtension` which calls `refresh!` and reloads the in-memory
cache of theme site settings from the DB.

c.f.
https://meta.discourse.org/t/difficulty-understanding-the-enable-welcome-banner-setting/377321
2025-08-12 14:18:32 +10:00
..
2024-11-01 19:19:25 +02:00
2023-02-21 10:30:48 +01:00