DEV: Move Discourse app specific concern out of unicorn conf.

DEV: Move Discourse app specific concern out of unicorn conf.

diff --git a/config/unicorn.conf.rb b/config/unicorn.conf.rb
index ffcafcb..b00fca1 100644
--- a/config/unicorn.conf.rb
+++ b/config/unicorn.conf.rb
@@ -257,14 +257,4 @@ end
 after_fork do |server, worker|
   DiscourseEvent.trigger(:web_fork_started)
   Discourse.after_fork
-
-  # 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
-  begin
-    # Skip warmup in development mode - it makes boot take ~2s longer
-    PrettyText.cook("warm up **pretty text**") if !Rails.env.development?
-  rescue => e
-    Rails.logger.error("Failed to warm up pretty text: #{e}")
-  end
 end
diff --git a/lib/discourse.rb b/lib/discourse.rb
index 641e06f..779f863 100644
--- a/lib/discourse.rb
+++ b/lib/discourse.rb
@@ -743,6 +743,17 @@ module Discourse
 
     DiscourseJsProcessor::Transpiler.reset_context if defined? DiscourseJsProcessor::Transpiler
     JsLocaleHelper.reset_context if defined? JsLocaleHelper
+
+    # 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
+    begin
+      # Skip warmup in development mode - it makes boot take ~2s longer
+      PrettyText.cook("warm up **pretty text**") if !Rails.env.development?
+    rescue => e
+      Rails.logger.error("Failed to warm up pretty text: #{e}")
+    end
+
     nil
   end
 

GitHub sha: cadf5eaf

This commit appears in #13264 which was approved by eviltrout. It was merged by tgxworld.