mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: Move Discourse app specific concern out of unicorn conf.
This commit is contained in:
parent
a8667b5454
commit
cadf5eafe6
@ -257,14 +257,4 @@ end
|
|||||||
after_fork do |server, worker|
|
after_fork do |server, worker|
|
||||||
DiscourseEvent.trigger(:web_fork_started)
|
DiscourseEvent.trigger(:web_fork_started)
|
||||||
Discourse.after_fork
|
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
|
end
|
||||||
|
@ -743,6 +743,17 @@ module Discourse
|
|||||||
|
|
||||||
DiscourseJsProcessor::Transpiler.reset_context if defined? DiscourseJsProcessor::Transpiler
|
DiscourseJsProcessor::Transpiler.reset_context if defined? DiscourseJsProcessor::Transpiler
|
||||||
JsLocaleHelper.reset_context if defined? JsLocaleHelper
|
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
|
nil
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user