From 3afda54d223c522130f672b80c97e03056d506c2 Mon Sep 17 00:00:00 2001 From: "Hongli Lai (Phusion)" Date: Mon, 22 Dec 2014 15:59:07 +0100 Subject: [PATCH] Run after_fork hooks correctly on Phusion Passenger --- config/application.rb | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/config/application.rb b/config/application.rb index acc2d501733..ffba6ba0c37 100644 --- a/config/application.rb +++ b/config/application.rb @@ -167,3 +167,11 @@ module Discourse end end + +if defined?(PhusionPassenger) + PhusionPassenger.on_event(:starting_worker_process) do |forked| + if forked + Discourse.after_fork + end + end +end