diff options
author | Andrew Newdigate <andrew@gitlab.com> | 2018-10-20 19:00:19 +0100 |
---|---|---|
committer | Andrew Newdigate <andrew@gitlab.com> | 2018-10-25 17:50:15 +0100 |
commit | 1065f8ce7a261dff5a3077be46405343141733df (patch) | |
tree | 92669873cb55a448de6a581a86d970148762d210 /config/initializers/macos.rb | |
parent | 605e952e39ddad4efa786ebc06a3175727563db5 (diff) | |
download | gitlab-ce-an-multithreading.tar.gz |
Add experimental support for Pumaan-multithreading
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 |