mirror of
https://github.com/discourse/discourse.git
synced 2024-11-25 10:20:58 -06:00
DEV: Fix undefined method due to rails_failover.
This commit is contained in:
parent
092ae858af
commit
b08a0d15c4
@ -1,7 +1,5 @@
|
|||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
return unless Rails.configuration.active_record_rails_failover
|
|
||||||
|
|
||||||
if defined?(RailsFailover::Redis)
|
if defined?(RailsFailover::Redis)
|
||||||
message_bus_keepalive_interval = nil
|
message_bus_keepalive_interval = nil
|
||||||
|
|
||||||
@ -19,6 +17,8 @@ if defined?(RailsFailover::Redis)
|
|||||||
end
|
end
|
||||||
|
|
||||||
if defined?(RailsFailover::ActiveRecord)
|
if defined?(RailsFailover::ActiveRecord)
|
||||||
|
return unless Rails.configuration.active_record_rails_failover
|
||||||
|
|
||||||
if Rails.configuration.multisite
|
if Rails.configuration.multisite
|
||||||
if ActiveRecord::Base.current_role == ActiveRecord::Base.reading_role
|
if ActiveRecord::Base.current_role == ActiveRecord::Base.reading_role
|
||||||
RailsMultisite::ConnectionManagement.default_connection_handler =
|
RailsMultisite::ConnectionManagement.default_connection_handler =
|
||||||
|
@ -25,9 +25,9 @@ if Rails.configuration.multisite
|
|||||||
Rails.configuration.middleware.unshift RailsMultisite::Middleware, RailsMultisite::DiscoursePatches.config
|
Rails.configuration.middleware.unshift RailsMultisite::Middleware, RailsMultisite::DiscoursePatches.config
|
||||||
Rails.configuration.middleware.delete ActionDispatch::Executor
|
Rails.configuration.middleware.delete ActionDispatch::Executor
|
||||||
|
|
||||||
if defined?(RailsFailover) && Rails.configuration.active_record_rails_failover
|
if defined?(RailsFailover::ActiveRecord) && Rails.configuration.active_record_rails_failover
|
||||||
Rails.configuration.middleware.insert_after(RailsMultisite::Middleware, RailsFailover::ActiveRecord::Middleware)
|
Rails.configuration.middleware.insert_after(RailsMultisite::Middleware, RailsFailover::ActiveRecord::Middleware)
|
||||||
end
|
end
|
||||||
elsif defined?(RailsFailover) && Rails.configuration.active_record_rails_failover
|
elsif defined?(RailsFailover::ActiveRecord) && Rails.configuration.active_record_rails_failover
|
||||||
Rails.configuration.middleware.insert_before(MessageBus::Rack::Middleware, RailsFailover::ActiveRecord::Middleware)
|
Rails.configuration.middleware.insert_before(MessageBus::Rack::Middleware, RailsFailover::ActiveRecord::Middleware)
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user