Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-09-09 15:09:09 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-09-09 15:09:09 +0300
commit7ce86c261b3f910cf17b0b47a4200847578947df (patch)
tree20665e6a2b836f9ab38ba86680fa39ba33a04f21 /lib/gitlab/throttle.rb
parent54573816ab79fac6716d1a1eae8c0da602765774 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'lib/gitlab/throttle.rb')
-rw-r--r--lib/gitlab/throttle.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/gitlab/throttle.rb b/lib/gitlab/throttle.rb
index df2b3fbc1af..f1acea80eaf 100644
--- a/lib/gitlab/throttle.rb
+++ b/lib/gitlab/throttle.rb
@@ -70,6 +70,20 @@ module Gitlab
{ limit: limit_proc, period: period_proc }
end
+ def self.unauthenticated_files_api_options
+ limit_proc = proc { |req| settings.throttle_unauthenticated_files_api_requests_per_period }
+ period_proc = proc { |req| settings.throttle_unauthenticated_files_api_period_in_seconds.seconds }
+
+ { limit: limit_proc, period: period_proc }
+ end
+
+ def self.authenticated_files_api_options
+ limit_proc = proc { |req| settings.throttle_authenticated_files_api_requests_per_period }
+ period_proc = proc { |req| settings.throttle_authenticated_files_api_period_in_seconds.seconds }
+
+ { limit: limit_proc, period: period_proc }
+ end
+
def self.rate_limiting_response_text
(settings.rate_limiting_response_text.presence || DEFAULT_RATE_LIMITING_RESPONSE_TEXT) + "\n"
end