File tree Expand file tree Collapse file tree 5 files changed +19
-0
lines changed
sentry-rails/lib/sentry/rails/log_subscribers Expand file tree Collapse file tree 5 files changed +19
-0
lines changed Original file line number Diff line number Diff line change 44
55- Add support for ActiveRecord binds in the log events ([ #2761 ] ( https://github.com/getsentry/sentry-ruby/pull/2761 ) )
66
7+ ### Bug Fixes
8+
9+ - Guard log subscribers with initialized check ([ #2765 ] ( https://github.com/getsentry/sentry-ruby/pull/2765 ) )
10+
711## 6.0.0
812
913### Breaking Changes
Original file line number Diff line number Diff line change @@ -27,6 +27,8 @@ class ActionControllerSubscriber < Sentry::Rails::LogSubscriber
2727 #
2828 # @param event [ActiveSupport::Notifications::Event] The controller action event
2929 def process_action ( event )
30+ return unless Sentry . initialized?
31+
3032 payload = event . payload
3133
3234 controller = payload [ :controller ]
Original file line number Diff line number Diff line change @@ -26,6 +26,8 @@ class ActionMailerSubscriber < Sentry::Rails::LogSubscriber
2626 #
2727 # @param event [ActiveSupport::Notifications::Event] The email delivery event
2828 def deliver ( event )
29+ return unless Sentry . initialized?
30+
2931 payload = event . payload
3032
3133 mailer = payload [ :mailer ]
@@ -57,6 +59,8 @@ def deliver(event)
5759 #
5860 # @param event [ActiveSupport::Notifications::Event] The email processing event
5961 def process ( event )
62+ return unless Sentry . initialized?
63+
6064 payload = event . payload
6165
6266 mailer = payload [ :mailer ]
Original file line number Diff line number Diff line change @@ -26,6 +26,8 @@ class ActiveJobSubscriber < Sentry::Rails::LogSubscriber
2626 #
2727 # @param event [ActiveSupport::Notifications::Event] The job performance event
2828 def perform ( event )
29+ return unless Sentry . initialized?
30+
2931 job = event . payload [ :job ]
3032 duration = duration_ms ( event )
3133
@@ -63,6 +65,8 @@ def perform(event)
6365 #
6466 # @param event [ActiveSupport::Notifications::Event] The job enqueue event
6567 def enqueue ( event )
68+ return unless Sentry . initialized?
69+
6670 job = event . payload [ :job ]
6771
6872 attributes = {
@@ -89,6 +93,8 @@ def enqueue(event)
8993 end
9094
9195 def retry_stopped ( event )
96+ return unless Sentry . initialized?
97+
9298 job = event . payload [ :job ]
9399 error = event . payload [ :error ]
94100
@@ -111,6 +117,8 @@ def retry_stopped(event)
111117 end
112118
113119 def discard ( event )
120+ return unless Sentry . initialized?
121+
114122 job = event . payload [ :job ]
115123 error = event . payload [ :error ]
116124
Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ class ActiveRecordSubscriber < Sentry::Rails::LogSubscriber
2929 #
3030 # @param event [ActiveSupport::Notifications::Event] The SQL event
3131 def sql ( event )
32+ return unless Sentry . initialized?
3233 return if EXCLUDED_NAMES . include? ( event . payload [ :name ] )
3334
3435 sql = event . payload [ :sql ]
You can’t perform that action at this time.
0 commit comments