Skip to content

Commit

Permalink
Update honeybadger notification conditions to account for the updated…
Browse files Browse the repository at this point in the history
… limits.
  • Loading branch information
cbeer committed Jul 10, 2024
1 parent bff8b4b commit b211195
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion config/initializers/rack_attack.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit b211195

Please sign in to comment.