Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

verify_active_connections! is deprecated in rails 4, what should we do to handle that functionality?

I've been following this post to setup puma with foreman:

https://www.digitalocean.com/community/articles/how-to-set-up-zero-downtime-rails-deploys-using-puma-and-foreman

The puma script says to verify_active_connections! after connecting but it's not available in rails 4. Commenting out the method call will make the script run but I'm not sure if this will leak resources or not.

The only documentation I can see in regards to this issue is:

https://github.com/socialcast/resque-ensure-connected/issues/3

But there's no conclusive answer on what to do. I think the options are to either omit it and rails will handle it now under the hood or do that each block that runs verify on each one. Does anyone have a real answer on what to do? Thanks.

like image 733
AntelopeSalad Avatar asked Oct 06 '13 22:10

AntelopeSalad


1 Answers

It appears that in Rails 4 it was removed in this commit:

https://github.com/rails/rails/commit/9d1f1b1

It seems that you now should be looking at:

ActiveRecord::Base.clear_active_connections!

Here's some github issues threads that discuss it:

  • https://github.com/resque/resque/issues/1098
  • https://github.com/socialcast/resque-ensure-connected/issues/3
like image 120
dreadwail Avatar answered Oct 05 '22 23:10

dreadwail