Skip to content

Commit

Permalink
FIX: Remove automatic failover on boot.
Browse files Browse the repository at this point in the history
Let the application decides what to do instead.
  • Loading branch information
tgxworld committed Jun 10, 2020
1 parent 66602aa commit deb9ff1
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions lib/rails_failover/active_record/railtie.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,6 @@ class Railtie < ::Rails::Railtie
connection_pool.spec
)
end

begin
::ActiveRecord::Base.connection
rescue ::ActiveRecord::NoDatabaseError
# Do nothing since database hasn't been created
rescue ::PG::Error => e
Handler.instance.verify_primary(::ActiveRecord::Base.writing_role)
::ActiveRecord::Base.connection_handler = ::ActiveRecord::Base.lookup_connection_handler(:reading)
end
end
end

Expand Down

0 comments on commit deb9ff1

Please sign in to comment.