Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove before_fork, on_worker_boot callbacks from puma config if they are no longer required #493

Open
eoinkelly opened this issue Sep 22, 2023 · 0 comments
Labels
discuss Discussion required

Comments

@eoinkelly
Copy link
Contributor

Our puma config includes:

  before_fork do
    ActiveRecord::Base.connection_pool.disconnect! if defined?(ActiveRecord)
  end

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

The puma docs do not mention this as being required. I haven't found anything online saying it is required but heroku/barnes#36 suggests that it might not be.

The default config/puma.rb generated by Rails 7 does not include these lines.

We should remove these lines if they are not required. Determining that needs more research and then trying it on some real apps before commiting it to this template.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
discuss Discussion required
Projects
None yet
Development

No branches or pull requests

1 participant