DEV: Fix undefined method.

This commit is contained in:
Guo Xiang Tan 2020-06-15 16:04:41 +08:00
parent f38438c6de
commit e0d798c06c
No known key found for this signature in database
GPG Key ID: FBD110179AAC1F20
2 changed files with 4 additions and 4 deletions

View File

@ -43,11 +43,11 @@ if ENV['SKIP_DB_AND_REDIS'] == '1'
GlobalSetting.skip_redis = true GlobalSetting.skip_redis = true
end end
if !GlobalSetting.skip_db if !GlobalSetting.skip_db?
require 'rails_failover/active_record' require 'rails_failover/active_record'
end end
if !GlobalSetting.skip_redis if !GlobalSetting.skip_redis?
require 'rails_failover/redis' require 'rails_failover/redis'
end end

View File

@ -1,6 +1,6 @@
# frozen_string_literal: true # frozen_string_literal: true
if !GlobalSetting.skip_redis if !GlobalSetting.skip_redis?
message_bus_keepalive_interval = nil message_bus_keepalive_interval = nil
RailsFailover::Redis.on_failover do RailsFailover::Redis.on_failover do
@ -16,7 +16,7 @@ if !GlobalSetting.skip_redis
end end
end end
if !GlobalSetting.skip_db if !GlobalSetting.skip_db?
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 =