summaryrefslogtreecommitdiff
path: root/config/initializers/macos.rb
blob: 3b669a73f49509fa49558d19c332d2819d985fed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
# frozen_string_literal: true

if RUBY_PLATFORM.include?('darwin')
  Gitlab::Cluster::LifecycleEvents.on_before_fork do
    require 'fiddle'

    # Dynamically load Foundation.framework, ~implicitly~ initialising
    # the Objective-C runtime before any forking happens in webserver
    #
    # From https://bugs.ruby-lang.org/issues/14009
    Fiddle.dlopen '/System/Library/Frameworks/Foundation.framework/Foundation'
  end
end