diff --git a/config/initializers/rack_attack.rb b/config/initializers/rack_attack.rb index d8b2e8c61..e11b7eb82 100644 --- a/config/initializers/rack_attack.rb +++ b/config/initializers/rack_attack.rb @@ -76,7 +76,7 @@ match_data = request.env['rack.attack.match_data'] now = match_data[:epoch_time] - if (Settings.SEND_THROTTLE_NOTIFICATIONS_TO_HONEYBADGER && match_data[:count] < 15) || (match_data[:count] % 10).zero? + if Settings.SEND_THROTTLE_NOTIFICATIONS_TO_HONEYBADGER && (((match_data[:limit] - match_data[:count]) < 5) || (match_data[:count] % 10).zero?) Honeybadger.notify("Throttling request", context: { ip: request.ip, path: request.path }.merge(match_data)) end