Commit 36f07e74 authored by Brett Walker's avatar Brett Walker

Move module EE::Gitlab::Throttle to it's own file

parent fe62f194
# 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 &&
......
# 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
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