Skip to content

Commit

Permalink
hotfix: prevent exception in record_one_broadcast_with_new_relic
Browse files Browse the repository at this point in the history
  • Loading branch information
nathan-appere committed Mar 14, 2024
1 parent 069464a commit 145c152
Showing 1 changed file with 7 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,13 @@
module NewRelic::Agent::Instrumentation
module ActiveSupportBroadcastLogger
def record_one_broadcast_with_new_relic(*args)
broadcasts[1..-1].each { |broadcasted_logger| broadcasted_logger.instance_variable_set(:@skip_instrumenting, true) }
yield
broadcasts.each { |broadcasted_logger| broadcasted_logger.instance_variable_set(:@skip_instrumenting, false) }
if broadcasts
broadcasts[1..-1].each { |broadcasted_logger| broadcasted_logger.instance_variable_set(:@skip_instrumenting, true) }
yield
broadcasts.each { |broadcasted_logger| broadcasted_logger.instance_variable_set(:@skip_instrumenting, false) }
else
::NewRelic::Agent.record_custom_event('NR Error - record_one_broadcast_with_new_relic - nil broadcasts')
end
end
end
end

0 comments on commit 145c152

Please sign in to comment.