Commit 07ccc89c authored by Ian Baum's avatar Ian Baum

Merge branch 'sh-disable-query-limiter' into 'master'

Disable query limiting warnings for now on GitLab.com

See merge request gitlab-org/gitlab-ce!17067
parents 0c372271 04b64288
...@@ -6,7 +6,7 @@ module Gitlab ...@@ -6,7 +6,7 @@ module Gitlab
# This ensures we don't produce any errors that users can't do anything # This ensures we don't produce any errors that users can't do anything
# about themselves. # about themselves.
def self.enable? def self.enable?
Gitlab.com? || Rails.env.development? || Rails.env.test? Rails.env.development? || Rails.env.test?
end end
# Allows the current request to execute any number of SQL queries. # Allows the current request to execute any number of SQL queries.
......
...@@ -12,14 +12,16 @@ describe Gitlab::QueryLimiting do ...@@ -12,14 +12,16 @@ describe Gitlab::QueryLimiting do
expect(described_class.enable?).to eq(true) expect(described_class.enable?).to eq(true)
end end
it 'returns true on GitLab.com' do it 'returns false on GitLab.com' do
expect(Rails.env).to receive(:development?).and_return(false)
expect(Rails.env).to receive(:test?).and_return(false)
allow(Gitlab).to receive(:com?).and_return(true) allow(Gitlab).to receive(:com?).and_return(true)
expect(described_class.enable?).to eq(true) expect(described_class.enable?).to eq(false)
end end
it 'returns true in a non GitLab.com' do it 'returns false in a non GitLab.com' do
expect(Gitlab).to receive(:com?).and_return(false) allow(Gitlab).to receive(:com?).and_return(false)
expect(Rails.env).to receive(:development?).and_return(false) expect(Rails.env).to receive(:development?).and_return(false)
expect(Rails.env).to receive(:test?).and_return(false) expect(Rails.env).to receive(:test?).and_return(false)
......
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