From 15932f391ed7352478de1dbca00b529ebee12e47 Mon Sep 17 00:00:00 2001 From: Sam Date: Mon, 23 Oct 2017 15:40:31 +1100 Subject: [PATCH] FEATURE: Add events when web and sidekiq forks start --- config/unicorn.conf.rb | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/config/unicorn.conf.rb b/config/unicorn.conf.rb index bc47ed7e85e..bc8a074d2ce 100644 --- a/config/unicorn.conf.rb +++ b/config/unicorn.conf.rb @@ -114,6 +114,8 @@ before_fork do |server, worker| require 'demon/sidekiq' + DiscourseEvent.trigger(:sidekiq_fork_started) + if @stats_socket_dir Demon::Sidekiq.after_fork do start_stats_socket(server) @@ -218,6 +220,8 @@ end after_fork do |server, worker| start_stats_socket(server) + DiscourseEvent.trigger(:web_fork_started) + # warm up v8 after fork, that way we do not fork a v8 context # it may cause issues if bg threads in a v8 isolate randomly stop # working due to fork