instance method
rate_limiting
Ruby on Rails 7.2.3.2
Since v7.2.3.2 Private — implementation detail, not part of the public APISignature
rate_limiting(to:, within:, by:, with:, store:)
No documentation comment.
Parameters
-
tokeyreq -
withinkeyreq -
bykeyreq -
withkeyreq -
storekeyreq
Source
# File actionpack/lib/action_controller/metal/rate_limiting.rb, line 53
def rate_limiting(to:, within:, by:, with:, store:)
count = store.increment("rate-limit:#{controller_path}:#{instance_exec(&by)}", 1, expires_in: within)
if count && count > to
ActiveSupport::Notifications.instrument("rate_limit.action_controller", request: request) do
instance_exec(&with)
end
end
end
Defined in actionpack/lib/action_controller/metal/rate_limiting.rb line 53
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActionController::RateLimiting