method
rate_limiting
v8.0.0 -
Show latest stable
- Class:
ActionController::RateLimiting
rate_limiting(to:, within:, by:, with:, store:, name:)private
No documentation available.
# File actionpack/lib/action_controller/metal/rate_limiting.rb, line 61
def rate_limiting(to,, within,, by,, with,, store,, name))
cache_key = ["rate-limit", controller_path, name, instance_exec(&by)].compact.join(":")
count = store.increment(cache_key, 1, expires_in: within)
if count && count > to
ActiveSupport::Notifications.instrument("rate_limit.action_controller", request: request) do
instance_exec(&with)
end
end
end