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:
Diffstat (limited to 'lib/api/helpers/rate_limiter.rb')
-rw-r--r--lib/api/helpers/rate_limiter.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/api/helpers/rate_limiter.rb b/lib/api/helpers/rate_limiter.rb
index be92277c25a..39940d86fbf 100644
--- a/lib/api/helpers/rate_limiter.rb
+++ b/lib/api/helpers/rate_limiter.rb
@@ -18,6 +18,10 @@ module API
render_api_error!({ error: _('This endpoint has been requested too many times. Try again later.') }, 429)
end
+
+ def mark_throttle!(key, scope:)
+ Gitlab::ApplicationRateLimiter.throttled?(key, scope: scope)
+ end
end
end
end