Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
0cc3485a
Commit
0cc3485a
authored
Feb 14, 2022
by
Robert May
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Enable branches API rate limit cache
Changelog: performance
parent
431ce1da
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
1 addition
and
11 deletions
+1
-11
config/feature_flags/development/api_caching_rate_limit_branches.yml
...ure_flags/development/api_caching_rate_limit_branches.yml
+0
-8
lib/api/branches.rb
lib/api/branches.rb
+1
-3
No files found.
config/feature_flags/development/api_caching_rate_limit_branches.yml
deleted
100644 → 0
View file @
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
lib/api/branches.rb
View file @
0cc3485a
...
...
@@ -42,9 +42,7 @@ module API
optional
:page_token
,
type:
String
,
desc:
'Name of branch to start the paginaition from'
end
get
':id/repository/branches'
,
urgency: :low
do
ff_enabled
=
Feature
.
enabled?
(
:api_caching_rate_limit_branches
,
user_project
,
default_enabled: :yaml
)
cache_action_if
(
ff_enabled
,
[
user_project
,
:branches
,
current_user
,
declared_params
],
expires_in:
30
.
seconds
)
do
cache_action
([
user_project
,
:branches
,
current_user
,
declared_params
],
expires_in:
30
.
seconds
)
do
user_project
.
preload_protected_branches
repository
=
user_project
.
repository
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment