diff options
author | Yorick Peterse <yorickpeterse@gmail.com> | 2018-02-13 17:50:19 +0000 |
---|---|---|
committer | Mark Fletcher <mark@gitlab.com> | 2018-02-13 18:23:36 +0000 |
commit | ed1c8857fecf50467a3466631140af31a28817cc (patch) | |
tree | 825d22a0ba3d944acbc6d6beb08e54eab0fd6fc5 | |
parent | 4c4b5f333e123e45d7433842505fc56e6c475445 (diff) | |
download | gitlab-ce-ed1c8857fecf50467a3466631140af31a28817cc.tar.gz |
Merge branch 'whitelisting' into 'master'
Remove Sentry reporting for query limiting
See merge request gitlab-org/gitlab-ce!17092
-rw-r--r-- | doc/development/query_count_limits.md | 5 | ||||
-rw-r--r-- | lib/gitlab/query_limiting/transaction.rb | 8 | ||||
-rw-r--r-- | spec/lib/gitlab/query_limiting/transaction_spec.rb | 12 |
3 files changed, 3 insertions, 22 deletions
diff --git a/doc/development/query_count_limits.md b/doc/development/query_count_limits.md index ebb6e0c2dac..310e3faf61b 100644 --- a/doc/development/query_count_limits.md +++ b/doc/development/query_count_limits.md @@ -1,8 +1,7 @@ # Query Count Limits -Each controller or API endpoint is allowed to execute up to 100 SQL queries. In -a production environment we'll only log an error in case this threshold is -exceeded, but in a test environment we'll raise an error instead. +Each controller or API endpoint is allowed to execute up to 100 SQL queries and +in test environments we'll raise an error when this threshold is exceeded. ## Solving Failing Tests diff --git a/lib/gitlab/query_limiting/transaction.rb b/lib/gitlab/query_limiting/transaction.rb index 3cbafadb0d0..66d7d9275cf 100644 --- a/lib/gitlab/query_limiting/transaction.rb +++ b/lib/gitlab/query_limiting/transaction.rb @@ -51,13 +51,7 @@ module Gitlab error = ThresholdExceededError.new(error_message) - if raise_error? - raise(error) - else - # Raven automatically logs to the Rails log if disabled, thus we don't - # need to manually log anything in case Sentry support is not enabled. - Raven.capture_exception(error) - end + raise(error) if raise_error? end def increment diff --git a/spec/lib/gitlab/query_limiting/transaction_spec.rb b/spec/lib/gitlab/query_limiting/transaction_spec.rb index b4231fcd0fa..b72b8574174 100644 --- a/spec/lib/gitlab/query_limiting/transaction_spec.rb +++ b/spec/lib/gitlab/query_limiting/transaction_spec.rb @@ -59,18 +59,6 @@ describe Gitlab::QueryLimiting::Transaction do expect { transaction.act_upon_results } .to raise_error(described_class::ThresholdExceededError) end - - it 'reports the error in Sentry if raising an error is disabled' do - expect(transaction) - .to receive(:raise_error?) - .and_return(false) - - expect(Raven) - .to receive(:capture_exception) - .with(an_instance_of(described_class::ThresholdExceededError)) - - transaction.act_upon_results - end end end |