summaryrefslogtreecommitdiff
path: root/config/unicorn.rb.example.development
diff options
context:
space:
mode:
authorLin Jen-Shin <godfat@godfat.org>2018-07-31 18:47:15 +0800
committerLin Jen-Shin <godfat@godfat.org>2018-07-31 19:02:59 +0800
commite315dca6ceb5528a9b2c0f6d76261281a61a65b9 (patch)
treeed6f4887ce8aff22aefeca9cdf2b6593eab77617 /config/unicorn.rb.example.development
parenteb8597a1b9eb575121f09b8b9904c0ad7cd489cc (diff)
downloadgitlab-ce-e315dca6ceb5528a9b2c0f6d76261281a61a65b9.tar.gz
Copy important changes from unicorn.rb.example to
unicorn.rb.example.development. Also remove unneeded configurations and update the comment accordingly. I think REE was long dead.
Diffstat (limited to 'config/unicorn.rb.example.development')
-rw-r--r--config/unicorn.rb.example.development17
1 files changed, 17 insertions, 0 deletions
diff --git a/config/unicorn.rb.example.development b/config/unicorn.rb.example.development
index 0df028648d1..5712549a66d 100644
--- a/config/unicorn.rb.example.development
+++ b/config/unicorn.rb.example.development
@@ -1,7 +1,15 @@
worker_processes 2
timeout 60
+preload_app true
+check_client_connection false
+
before_fork do |server, worker|
+ # the following is highly recommended for Rails + "preload_app true"
+ # as there's no need for the master process to hold a connection
+ defined?(ActiveRecord::Base) and
+ ActiveRecord::Base.connection.disconnect!
+
if /darwin/ =~ RUBY_PLATFORM
require 'fiddle'
@@ -13,3 +21,12 @@ before_fork do |server, worker|
end
end
+after_fork do |server, worker|
+ # Unicorn clears out signals before it forks, so rbtrace won't work
+ # unless it is enabled after the fork.
+ require 'rbtrace' if ENV['ENABLE_RBTRACE']
+
+ # the following is *required* for Rails + "preload_app true",
+ defined?(ActiveRecord::Base) and
+ ActiveRecord::Base.establish_connection
+end