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

@@ -10,10 +10,7 @@ end
if defined?(PhusionPassenger)
PhusionPassenger.on_event(:starting_worker_process) do |forked|
if forked
# We're in smart spawning mode.
$redis = DiscourseRedis.new
Discourse::Application.config.cache_store.reconnect
MessageBus.after_fork
Discourse.after_fork
else
# We're in conservative spawning mode. We don't need to do anything.
end