Quellcode durchsuchen
Improve ActiveRecord connection in on_worker_boot (#9238)
This is how it looks in the example in the Puma README
master
Eugen Rochko
vor 5 Jahren
committed by
GitHub
Ursprung
Commit
ed7c5f94f7
Es konnte kein GPG-Schlüssel zu dieser Signatur gefunden werden
GPG-Schlüssel-ID: 4AEE18F83AFDEB23
1 geänderte Dateien mit
3 neuen und
1 gelöschten Zeilen
-
config/puma.rb
|
|
@@ -13,7 +13,9 @@ workers ENV.fetch('WEB_CONCURRENCY') { 2 } |
|
|
|
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 |