Commit 5c724bd0 authored by Stan Hu's avatar Stan Hu

Merge branch 'fix-for-puma-rails-s' into 'master'

Fix for puma issue running via `rails s`

See merge request gitlab-org/gitlab!23603
parents 9603ebdc 6e089643
......@@ -16,7 +16,9 @@ module Gitlab
end
def running_puma_with_multiple_threads?
Gitlab::Runtime.puma? && ::Puma.cli_config.options[:max_threads] > 1
return false unless Gitlab::Runtime.puma?
::Puma.respond_to?(:cli_config) && ::Puma.cli_config.options[:max_threads] > 1
end
def execute_rugged_call(method_name, *args)
......
......@@ -122,6 +122,12 @@ describe Gitlab::Git::RuggedImpl::UseRugged, :seed_helper do
allow(Gitlab::Runtime).to receive(:puma?).and_return(true)
end
it "returns false when Puma doesn't support the cli_config method" do
allow(::Puma).to receive(:respond_to?).with(:cli_config).and_return(false)
expect(subject.running_puma_with_multiple_threads?).to be_falsey
end
it 'returns false for single thread Puma' do
allow(::Puma).to receive_message_chain(:cli_config, :options).and_return(max_threads: 1)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment