diff options
Diffstat (limited to 'lib/gitlab/throttle.rb')
-rw-r--r-- | lib/gitlab/throttle.rb | 6 |
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 |