Skip to content

Commit

Permalink
fix the separation of the notifier configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
stuzart committed Jan 9, 2025
1 parent 685448b commit a472793
Showing 1 changed file with 12 additions and 14 deletions.
26 changes: 12 additions & 14 deletions lib/seek/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -106,25 +106,23 @@ def configure_recaptcha_keys
end

def configure_exception_notification
if exception_notification_enabled && Rails.env.production?
if true#exception_notification_enabled && Rails.env.production?
ExceptionNotification.configure do |config|
config.register_exception_notifier :email, {
ignore_exceptions: ['ActionDispatch::Http::Parameters::ParseError',
'ActionController::InvalidAuthenticityToken',
'ActionController::UnknownHttpMethod',
'ActionController::BadRequest'] + ExceptionNotifier.ignored_exceptions,
email: {
sender_address: [noreply_sender],
email_prefix: "[ #{instance_name} ERROR ] ",
exception_recipients: exception_notification_recipients.nil? ? [] : exception_notification_recipients.split(/[, ]/)
},
error_grouping: error_grouping_enabled,
error_grouping_period: error_grouping_timeout,
notification_trigger: ->(exception, count) {
config.ignored_exceptions = ['ActionDispatch::Http::Parameters::ParseError',
'ActionController::InvalidAuthenticityToken',
'ActionController::UnknownHttpMethod',
'ActionController::BadRequest'] | ExceptionNotifier.ignored_exceptions
config.error_grouping = error_grouping_enabled,
config.error_grouping_period = error_grouping_timeout,
config.notification_trigger = ->(exception, count) {
# Send notifications at count = x^0, x^1, x^3, x^4... where
# x = error_grouping_log_base
(Math.log(count, error_grouping_log_base) % 1).zero?
}
config.register_exception_notifier :email, {
sender_address: [noreply_sender],
email_prefix: "[ #{instance_name} ERROR ] ",
exception_recipients: exception_notification_recipients.nil? ? [] : exception_notification_recipients.split(/[, ]/)
}
end
else
Expand Down

0 comments on commit a472793

Please sign in to comment.