add rate limit

This commit is contained in:
Pete Matsyburka committed 2024-03-16 23:22:11 +02:00
1 parent 265b668cb4
commit 749722a9df
4 files changed
+33

No files matched your search

@@ -19,6 +19,12 @@ module Api
render json: { error: e.message }, status: :unprocessable_entity
end
rescue_from RateLimit::LimitApproached do |e|
Rollbar.error(e) if defined?(Rollbar)
render json: { error: 'Too many requests' }, status: :too_many_requests
end
if Rails.env.production?
rescue_from CanCan::AccessDenied do |e|
Rollbar.warning(e) if defined?(Rollbar)