Class: RailsErrorDashboard::SlackErrorNotificationJob

Inherits:
ApplicationJob
  • Object
show all
Defined in:
app/jobs/rails_error_dashboard/slack_error_notification_job.rb

Instance Method Summary collapse

Instance Method Details

#perform(error_log_id) ⇒ Object



7
8
9
10
11
12
13
14
15
16
17
# File 'app/jobs/rails_error_dashboard/slack_error_notification_job.rb', line 7

def perform(error_log_id)
  error_log = ErrorLog.find_by(id: error_log_id)
  return unless error_log

  webhook_url = RailsErrorDashboard.configuration.slack_webhook_url
  return unless webhook_url.present?

  send_slack_notification(error_log, webhook_url)
rescue => e
  Rails.logger.error("Failed to send Slack notification: #{e.message}")
end