mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 08:49:06 +08: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|
|
||||
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
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user