DEV: Update message_bus to 4.0.0 (#15553)

This commit is contained in:
Jarek Radosz 2022-01-12 22:14:52 +01:00 committed by GitHub
parent c593727497
commit aee9fcd257
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 5 deletions

View File

@ -227,7 +227,7 @@ GEM
lz4-ruby (0.3.3) lz4-ruby (0.3.3)
maxminddb (0.1.22) maxminddb (0.1.22)
memory_profiler (1.0.0) memory_profiler (1.0.0)
message_bus (3.4.0) message_bus (4.0.0)
rack (>= 1.1.3) rack (>= 1.1.3)
method_source (1.0.0) method_source (1.0.0)
mini_mime (1.1.2) mini_mime (1.1.2)

View File

@ -68,7 +68,6 @@ def setup_message_bus_env(env)
group_ids: group_ids, group_ids: group_ids,
is_admin: is_admin, is_admin: is_admin,
site_id: RailsMultisite::ConnectionManagement.current_db site_id: RailsMultisite::ConnectionManagement.current_db
} }
env["__mb"] = hash env["__mb"] = hash
end end
@ -117,7 +116,8 @@ if Rails.env == "test"
else else
MessageBus.redis_config = GlobalSetting.message_bus_redis_config MessageBus.redis_config = GlobalSetting.message_bus_redis_config
end end
MessageBus.reliable_pub_sub.max_backlog_size = GlobalSetting.message_bus_max_backlog_size
MessageBus.backend_instance.max_backlog_size = GlobalSetting.message_bus_max_backlog_size
if SiteSetting.table_exists? && SiteSetting.where(name: ['enable_long_polling', 'long_polling_interval']).exists? 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') 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')
@ -129,8 +129,6 @@ else
MessageBus.long_polling_interval = GlobalSetting.long_polling_interval || 25000 MessageBus.long_polling_interval = GlobalSetting.long_polling_interval || 25000
end end
MessageBus.cache_assets = !Rails.env.development?
if Rails.env == "test" || $0 =~ /rake$/ if Rails.env == "test" || $0 =~ /rake$/
# disable keepalive in testing # disable keepalive in testing
MessageBus.keepalive_interval = -1 MessageBus.keepalive_interval = -1