BUGFIX: Correct after_fork semantics

After fork SiteSettings was not getting a new process id,
causing site settings not to refresh properly in unicorn

This code also centralizes the logic
This commit is contained in:
Sam
2014-03-28 13:48:14 +11:00
parent 956b14a4ab
commit f3cc7360e0
8 changed files with 23 additions and 27 deletions

View File

@ -118,11 +118,7 @@ class Demon::Base
end
def establish_app
ActiveRecord::Base.connection_handler.clear_active_connections!
ActiveRecord::Base.establish_connection
$redis.client.reconnect
Rails.cache.reconnect
MessageBus.after_fork
Discourse.after_fork
Signal.trap("HUP") do
begin