FEATURE: Add events when web and sidekiq forks start

This commit is contained in:
Sam 2017-10-23 15:40:31 +11:00
parent d5e369d6cf
commit 15932f391e

View File

@ -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