Commit 3c5586c2 authored by Ismael Posada Trobo's avatar Ismael Posada Trobo
Browse files

DEV: Improve bin/unicorn boot time in development environment...

DEV: Improve bin/unicorn boot time in development environment (
parent a6305422
......@@ -249,18 +249,19 @@ before_fork do |server, worker|
# to the implementation of standard Unix signal handlers, this
# helps (but does not completely) prevent identical, repeated signals
# from being lost when the receiving process is busy.
sleep 1
sleep 1 if !Rails.env.development?
after_fork do |server, worker|
# 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
PrettyText.cook("warm up **pretty text**")
# 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}")
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment