diff options
author | Yorick Peterse <yorickpeterse@gmail.com> | 2018-01-15 16:21:04 +0100 |
---|---|---|
committer | Yorick Peterse <yorickpeterse@gmail.com> | 2018-02-01 17:00:46 +0100 |
commit | cca61980d5ad9c4db65b9498fe49d936657bc0e2 (patch) | |
tree | 1a844c4121c0530ea35f29d035e65a16be6e491a /lib/api/branches.rb | |
parent | 5b73e0eb35f5b9b78c228a4867ef78538ef05653 (diff) | |
download | gitlab-ce-cca61980d5ad9c4db65b9498fe49d936657bc0e2.tar.gz |
Track and act upon the number of executed queriesquery-counts
This ensures that we have more visibility in the number of SQL queries
that are executed in web requests. The current threshold is hardcoded to
100 as we will rarely (maybe once or twice) change it.
In production and development we use Sentry if enabled, in the test
environment we raise an error. This feature is also only enabled in
production/staging when running on GitLab.com as it's not very useful to
other users.
Diffstat (limited to 'lib/api/branches.rb')
-rw-r--r-- | lib/api/branches.rb | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/api/branches.rb b/lib/api/branches.rb index 0791a110c39..1794207e29b 100644 --- a/lib/api/branches.rb +++ b/lib/api/branches.rb @@ -29,6 +29,8 @@ module API use :pagination end get ':id/repository/branches' do + Gitlab::QueryLimiting.whitelist('https://gitlab.com/gitlab-org/gitlab-ce/issues/42329') + repository = user_project.repository branches = ::Kaminari.paginate_array(repository.branches.sort_by(&:name)) merged_branch_names = repository.merged_branch_names(branches.map(&:name)) |