Skip to content

Commit

Permalink
APPEALS-26715 formatting updates
Browse files Browse the repository at this point in the history
  • Loading branch information
AKeyframe committed Aug 2, 2023
1 parent 3321378 commit 812571f
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions config/initializers/deprecation_warning_subscriber.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,7 @@
# @note For use in conjuction with setting `Rails.application.config.active_support.deprecation = :notify`.
# Whenever a “deprecation.rails” notification is published, it will dispatch the event
# (ActiveSupport::Notifications::Event) to method #deprecation.

class DeprecationWarningSubscriber > ActiveSupport::Subscriber
class DeprecationWarningSubscriber < ActiveSupport::Subscriber
SLACK_ALERT_TITLE = "Deprecation Warning"
SLACK_ALERT_CHANNEL = "#appeals-deprecation-alerts"

Expand All @@ -16,15 +15,12 @@ def deprecation(event)
emit_warning_to_slack_alerts_channel(event)
end



private

def emit_warning_to_application_logs(event)
Rails.logger.warn(event.payload[:message])
end


def emit_warning_to_sentry(event)
Raven.capture_message(
event.payload[:message],
Expand All @@ -37,13 +33,9 @@ def emit_warning_to_sentry(event)
)
end


def emit_warning_to_slack_alerts_channel(event)
SlackService
.new(url: ENV["SLACK_DISPATCH_ALERT_URL"])
.send_notification(event.payload[:message], SLACK_ALERT_TITLE, SLACK_ALERT_CHANNEL)
end
end


end
end

0 comments on commit 812571f

Please sign in to comment.