mirror of
https://github.com/discourse/discourse.git
synced 2024-11-22 14:38:17 +08:00
PERF: Preload LetterAvatar.image_magick_version
in master process.
It is wasteful to run the clean up and command to generate the version digest on every unicorn child process.
This commit is contained in:
parent
4b7b586861
commit
4bad1e7e93
|
@ -935,16 +935,25 @@ module Discourse
|
|||
Search.prepare_data("test")
|
||||
end
|
||||
|
||||
# router warm up
|
||||
Rails.application.routes.recognize_path('abc') rescue nil
|
||||
|
||||
# preload discourse version
|
||||
Discourse.git_version
|
||||
Discourse.git_branch
|
||||
Discourse.full_version
|
||||
|
||||
require 'actionview_precompiler'
|
||||
ActionviewPrecompiler.precompile
|
||||
[
|
||||
Thread.new {
|
||||
# router warm up
|
||||
Rails.application.routes.recognize_path('abc') rescue nil
|
||||
},
|
||||
Thread.new {
|
||||
# preload discourse version
|
||||
Discourse.git_version
|
||||
Discourse.git_branch
|
||||
Discourse.full_version
|
||||
},
|
||||
Thread.new {
|
||||
require 'actionview_precompiler'
|
||||
ActionviewPrecompiler.precompile
|
||||
},
|
||||
Thread.new {
|
||||
LetterAvatar.image_magick_version
|
||||
}
|
||||
].each(&:join)
|
||||
ensure
|
||||
@preloaded_rails = true
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue
Block a user