mirror of
https://github.com/discourse/discourse.git
synced 2024-11-26 05:03:39 +08:00
DEV: Don't clear cache/trigger events if site setting hasn't changed (#15045)
This commit is contained in:
parent
d91d67a442
commit
648332bc9f
|
@ -355,6 +355,9 @@ module SiteSettingExtension
|
|||
old_val = current[name]
|
||||
provider.destroy(name)
|
||||
current[name] = defaults.get(name, default_locale)
|
||||
|
||||
return if current[name] == old_val
|
||||
|
||||
clear_uploads_cache(name)
|
||||
clear_cache!
|
||||
DiscourseEvent.trigger(:site_setting_changed, name, old_val, current[name]) if old_val != current[name]
|
||||
|
@ -369,6 +372,9 @@ module SiteSettingExtension
|
|||
sanitized_val = sanitize_override ? sanitize_field(val) : val
|
||||
provider.save(name, sanitized_val, type)
|
||||
current[name] = type_supervisor.to_rb_value(name, sanitized_val)
|
||||
|
||||
return if current[name] == old_val
|
||||
|
||||
clear_uploads_cache(name)
|
||||
notify_clients!(name) if client_settings.include? name
|
||||
clear_cache!
|
||||
|
|
Loading…
Reference in New Issue
Block a user