summaryrefslogtreecommitdiff
path: root/lib/gitlab/throttle.rb
diff options
context:
space:
mode:
authorRobert Speicher <rspeicher@gmail.com>2021-01-20 13:34:23 -0600
committerRobert Speicher <rspeicher@gmail.com>2021-01-20 13:34:23 -0600
commit6438df3a1e0fb944485cebf07976160184697d72 (patch)
tree00b09bfd170e77ae9391b1a2f5a93ef6839f2597 /lib/gitlab/throttle.rb
parent42bcd54d971da7ef2854b896a7b34f4ef8601067 (diff)
downloadgitlab-ce-6438df3a1e0fb944485cebf07976160184697d72.tar.gz
Add latest changes from gitlab-org/gitlab@13-8-stable-eev13.8.0-rc42
Diffstat (limited to 'lib/gitlab/throttle.rb')
-rw-r--r--lib/gitlab/throttle.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/gitlab/throttle.rb b/lib/gitlab/throttle.rb
index aebf8d92cb3..520075012e8 100644
--- a/lib/gitlab/throttle.rb
+++ b/lib/gitlab/throttle.rb
@@ -2,6 +2,8 @@
module Gitlab
class Throttle
+ DEFAULT_RATE_LIMITING_RESPONSE_TEXT = 'Retry later'
+
def self.settings
Gitlab::CurrentSettings.current_application_settings
end
@@ -46,5 +48,9 @@ module Gitlab
{ 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
end
end