Skip to content

Commit

Permalink
🔧 Increase rate limits
Browse files Browse the repository at this point in the history
  • Loading branch information
skerit committed Sep 6, 2024
1 parent fee527c commit dcd9d1c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions app/lib/rate_limiter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ class RateLimiter

FAMILIES = {
follows: {
limit: 400,
limit: 800,
period: 24.hours.freeze,
}.freeze,

statuses: {
limit: 300,
limit: 600,
period: 3.hours.freeze,
}.freeze,

Expand Down
6 changes: 3 additions & 3 deletions config/initializers/rack_attack.rb
Original file line number Diff line number Diff line change
Expand Up @@ -66,11 +66,11 @@ def paging_request?
IpBlock.blocked?(req.remote_ip)
end

throttle('throttle_authenticated_api', limit: 1_500, period: 5.minutes) do |req|
throttle('throttle_authenticated_api', limit: 3_000, period: 5.minutes) do |req|
req.authenticated_user_id if req.api_request?
end

throttle('throttle_per_token_api', limit: 300, period: 5.minutes) do |req|
throttle('throttle_per_token_api', limit: 1_500, period: 5.minutes) do |req|
req.authenticated_token_id if req.api_request?
end

Expand All @@ -90,7 +90,7 @@ def paging_request?
req.throttleable_remote_ip if req.post? && req.path == '/api/v1/accounts'
end

throttle('throttle_authenticated_paging', limit: 300, period: 15.minutes) do |req|
throttle('throttle_authenticated_paging', limit: 600, period: 15.minutes) do |req|
req.authenticated_user_id if req.paging_request?
end

Expand Down

0 comments on commit dcd9d1c

Please sign in to comment.