DEV: Deprecate message bus site settings (#14465)

It makes much more sense for these to be GlobalSettings, since, in
multisite clusters, only the default site's settings would be respected.

Co-authored-by: David Taylor <david@taylorhq.com>
This commit is contained in:
Daniel Waterworth 2021-11-11 11:12:25 -06:00 committed by GitHub
parent 61d14a7694
commit fa3c4ad28b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 2 deletions

View File

@ -339,3 +339,9 @@ cluster_name =
# The YAML file used to configure multisite clusters
multisite_config_path = config/multisite.yml
# If false, only short (regular) polling will be attempted
enable_long_polling =
# Length of time to hold open a long polling connection in milliseconds
long_polling_interval =

View File

@ -119,8 +119,16 @@ else
end
MessageBus.reliable_pub_sub.max_backlog_size = GlobalSetting.message_bus_max_backlog_size
MessageBus.long_polling_enabled = SiteSetting.enable_long_polling
MessageBus.long_polling_interval = SiteSetting.long_polling_interval
if SiteSetting.table_exists? && SiteSetting.where(name: ['enable_long_polling', 'long_polling_interval']).exists?
Discourse.deprecate("enable_long_polling/long_polling_interval have switched from site settings to global settings. Remove the override from the Site Settings UI, and use a config file or environment variables to set the global settings.", drop_from: '2.9.0')
MessageBus.long_polling_enabled = SiteSetting.enable_long_polling
MessageBus.long_polling_interval = SiteSetting.long_polling_interval
else
MessageBus.long_polling_enabled = GlobalSetting.enable_long_polling.nil? ? true : GlobalSetting.enable_long_polling
MessageBus.long_polling_interval = GlobalSetting.long_polling_interval || 25000
end
MessageBus.cache_assets = !Rails.env.development?
MessageBus.enable_diagnostics