diff options
author | Stan Hu <stanhu@gmail.com> | 2018-07-29 04:12:34 +0300 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2018-07-30 18:12:45 +0300 |
commit | 820923664ddf353533892f0af21ed3822508a655 (patch) | |
tree | 6d9d02057c17bd9e4655bcf5f920543413a56365 /config/initializers/rbtrace.rb | |
parent | 036c6db81362e3eff84eefcdb8c1e72bb79ab77c (diff) |
Make rbtrace work under unicorn
The Unicorn master resets any signal handlers and prevents rbtrace
from working properly as a result. Move the `require 'rbtrace'` call
to the Unicorn `after_fork` block and keep the initializer only for Sidekiq.
Diffstat (limited to 'config/initializers/rbtrace.rb')
-rw-r--r-- | config/initializers/rbtrace.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/config/initializers/rbtrace.rb b/config/initializers/rbtrace.rb index 3a076c99ad0..c96e6985cda 100644 --- a/config/initializers/rbtrace.rb +++ b/config/initializers/rbtrace.rb @@ -1,3 +1,5 @@ # frozen_string_literal: true -require 'rbtrace' if ENV['ENABLE_RBTRACE'] +# rbtrace needs to be included after the unicorn worker forks. +# See the after_fork block in config/unicorn.rb.example. +require 'rbtrace' if ENV['ENABLE_RBTRACE'] && Sidekiq.server? |