diff options
Diffstat (limited to 'lib/api/helpers/rate_limiter.rb')
-rw-r--r-- | lib/api/helpers/rate_limiter.rb | 4 |
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 |