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
36f07e74
Commit
36f07e74
authored
Oct 10, 2019
by
Brett Walker
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Move module EE::Gitlab::Throttle to it's own file
parent
fe62f194
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
14 additions
and
13 deletions
+14
-13
ee/lib/ee/gitlab/rack/attack.rb
ee/lib/ee/gitlab/rack/attack.rb
+0
-13
ee/lib/ee/gitlab/throttle.rb
ee/lib/ee/gitlab/throttle.rb
+14
-0
No files found.
ee/lib/ee/gitlab/rack/attack.rb
View file @
36f07e74
# frozen_string_literal: true
# frozen_string_literal: true
module
EE::Gitlab::Throttle
def
self
.
settings
Gitlab
::
Throttle
.
settings
end
def
self
.
incident_management_options
limit_proc
=
proc
{
|
req
|
settings
.
throttle_incident_management_notification_per_period
}
period_proc
=
proc
{
|
req
|
settings
.
throttle_incident_management_notification_period_in_seconds
.
seconds
}
{
limit:
limit_proc
,
period:
period_proc
}
end
end
module
EE::Gitlab::Rack::Attack
module
EE::Gitlab::Rack::Attack
Rack
::
Attack
.
throttle
(
'throttle_incident_management_notification_web'
,
EE
::
Gitlab
::
Throttle
.
incident_management_options
)
do
|
req
|
Rack
::
Attack
.
throttle
(
'throttle_incident_management_notification_web'
,
EE
::
Gitlab
::
Throttle
.
incident_management_options
)
do
|
req
|
EE
::
Gitlab
::
Throttle
.
settings
.
throttle_incident_management_notification_enabled
&&
EE
::
Gitlab
::
Throttle
.
settings
.
throttle_incident_management_notification_enabled
&&
...
...
ee/lib/ee/gitlab/throttle.rb
0 → 100644
View file @
36f07e74
# frozen_string_literal: true
module
EE::Gitlab::Throttle
def
self
.
settings
Gitlab
::
Throttle
.
settings
end
def
self
.
incident_management_options
limit_proc
=
proc
{
|
req
|
settings
.
throttle_incident_management_notification_per_period
}
period_proc
=
proc
{
|
req
|
settings
.
throttle_incident_management_notification_period_in_seconds
.
seconds
}
{
limit:
limit_proc
,
period:
period_proc
}
end
end
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