seuros / capistrano-puma

Puma integration for Capistrano
https://github.com/seuros/capistrano-puma
MIT License
615 stars 299 forks source link

Support Sequel #293

Closed MarcPer closed 3 years ago

MarcPer commented 4 years ago

Sequel is a widely used ORM alternative to ActiveRecord, and just as with ActiveRecord, it needs to be disconnected on before_fork if preload_app! is used.

For handling ActiveRecord, there's currently in puma.rb.erb:

before_fork do
  ActiveRecord::Base.connection_pool.disconnect!
end

For Sequel it would be like this:

before_fork do
  Sequel::Model.db.disconnect if defined?(Sequel::Model)
end

Could we include a setting puma_init_sequel in the spirit of puma_init_active_record and include the snippet above in the template?

github-actions[bot] commented 3 years ago

Stale issue message