diff options
author | Andrew Newdigate <andrew@gitlab.com> | 2018-10-20 21:00:19 +0300 |
---|---|---|
committer | Andrew Newdigate <andrew@gitlab.com> | 2018-10-25 19:50:15 +0300 |
commit | 1065f8ce7a261dff5a3077be46405343141733df (patch) | |
tree | 92669873cb55a448de6a581a86d970148762d210 /config/initializers/macos.rb | |
parent | 605e952e39ddad4efa786ebc06a3175727563db5 (diff) |
Add experimental support for Puma
This allows us (and others) to test drive Puma without it affecting all
users. Puma can be enabled by setting the environment variable
"EXPERIMENTAL_PUMA" to a non empty value.
Diffstat (limited to 'config/initializers/macos.rb')
-rw-r--r-- | config/initializers/macos.rb | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/config/initializers/macos.rb b/config/initializers/macos.rb new file mode 100644 index 00000000000..f410af6ed47 --- /dev/null +++ b/config/initializers/macos.rb @@ -0,0 +1,13 @@ +# frozen_string_literal: true + +if /darwin/ =~ RUBY_PLATFORM + Gitlab::Cluster::LifecycleEvents.on_before_fork do + require 'fiddle' + + # Dynamically load Foundation.framework, ~implicitly~ initialising + # the Objective-C runtime before any forking happens in Unicorn + # + # From https://bugs.ruby-lang.org/issues/14009 + Fiddle.dlopen '/System/Library/Frameworks/Foundation.framework/Foundation' + end +end |