Skip to content

Commit

Permalink
Update sentry-delayed_job/lib/sentry/delayed_job/plugin.rb
Browse files Browse the repository at this point in the history
Co-authored-by: Stan Lo <[email protected]>
  • Loading branch information
sl0thentr0py and st0012 committed Jan 23, 2024
1 parent 67c11c4 commit 8485799
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions sentry-delayed_job/lib/sentry/delayed_job/plugin.rb
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,10 @@ def self.extract_trace_data(job)
payload_object = job.payload_object
return nil unless payload_object.is_a?(Delayed::PerformableMethod)

ind = payload_object.args.index { |a| a.is_a?(Hash) && a.key?(:sentry) }
return nil unless ind

env = payload_object.args[ind][:sentry]
payload_object.args.delete_at(ind)
env
target_payload = payload_object.args.find { |a| a.is_a?(Hash) && a.key?(:sentry) }
return nil unless target_payload
payload_object.args.delete(target_payload)
target_payload[:sentry]
end
end
end
Expand Down

0 comments on commit 8485799

Please sign in to comment.