We added this option in commit d17b2523c, but Bundler now keeps
descriptors by default. While this behavior was backported to Ruby
3.0.x, we're changing it now because, we've only noticed it now that
we're upgrading to Ruby 3.1.x, since it was first developed for that
version [1].
[1] https://github.com/rubygems/rubygems/pull/4812/commits/88b7a3e7e2
37 lines
701 B
Ruby
37 lines
701 B
Ruby
#!/usr/bin/env puma
|
|
|
|
rails_root = File.expand_path("../../..", __FILE__)
|
|
|
|
directory rails_root
|
|
rackup "#{rails_root}/config.ru"
|
|
|
|
tag ""
|
|
|
|
pidfile "#{rails_root}/tmp/pids/puma.pid"
|
|
state_path "#{rails_root}/tmp/pids/puma.state"
|
|
stdout_redirect "#{rails_root}/log/puma_access.log", "#{rails_root}/log/puma_error.log", true
|
|
|
|
bind "unix://#{rails_root}/tmp/sockets/puma.sock"
|
|
daemonize
|
|
|
|
threads 0, 16
|
|
workers 2
|
|
preload_app!
|
|
|
|
plugin :tmp_restart
|
|
|
|
on_restart do
|
|
puts "Refreshing Gemfile"
|
|
ENV["BUNDLE_GEMFILE"] = ""
|
|
end
|
|
|
|
before_fork do
|
|
ActiveRecord::Base.connection_pool.disconnect!
|
|
end
|
|
|
|
on_worker_boot do
|
|
ActiveSupport.on_load(:active_record) do
|
|
ActiveRecord::Base.establish_connection
|
|
end
|
|
end
|