Skip to content
This repository has been archived by the owner on May 16, 2019. It is now read-only.

Commit

Permalink
Improve ActiveRecord connection in on_worker_boot (mastodon#9238)
Browse files Browse the repository at this point in the history
This is how it looks in the example in the Puma README
  • Loading branch information
Gargron committed Nov 23, 2018
1 parent 63f168c commit f73b7e7
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion config/puma.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@
preload_app!

on_worker_boot do
ActiveRecord::Base.establish_connection if defined?(ActiveRecord)
ActiveSupport.on_load(:active_record) do
ActiveRecord::Base.establish_connection
end
end

plugin :tmp_restart

0 comments on commit f73b7e7

Please sign in to comment.