Commit 0cc3485a authored by Robert May's avatar Robert May

Enable branches API rate limit cache

Changelog: performance
parent 431ce1da
---
name: api_caching_rate_limit_branches
introduced_by_url: https://gitlab.com/gitlab-org/gitlab/-/merge_requests/61688
rollout_issue_url: https://gitlab.com/gitlab-org/gitlab/-/issues/330876
milestone: '13.12'
type: development
group: group::source code
default_enabled: true
...@@ -42,9 +42,7 @@ module API ...@@ -42,9 +42,7 @@ module API
optional :page_token, type: String, desc: 'Name of branch to start the paginaition from' optional :page_token, type: String, desc: 'Name of branch to start the paginaition from'
end end
get ':id/repository/branches', urgency: :low do get ':id/repository/branches', urgency: :low do
ff_enabled = Feature.enabled?(:api_caching_rate_limit_branches, user_project, default_enabled: :yaml) cache_action([user_project, :branches, current_user, declared_params], expires_in: 30.seconds) do
cache_action_if(ff_enabled, [user_project, :branches, current_user, declared_params], expires_in: 30.seconds) do
user_project.preload_protected_branches user_project.preload_protected_branches
repository = user_project.repository repository = user_project.repository
......
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