Skip to content

Commit

Permalink
fix: use AR#clear_active_connections! in rails 4
Browse files Browse the repository at this point in the history
  • Loading branch information
isqad committed Sep 18, 2018
1 parent c80eab0 commit 4f2653c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/treasury/bg_executor/daemon.rb
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,11 @@ def reconnect!
pool.connections.each(&:reconnect!)
end

ActiveRecord::Base.verify_active_connections!
if ::Rails::VERSION::MAJOR < 4
ActiveRecord::Base.verify_active_connections!
else
ActiveRecord::Base.clear_active_connections!
end
rescue Exception => e
log "Could not reconnect!"
log e.message
Expand Down

0 comments on commit 4f2653c

Please sign in to comment.