lib/sentry/rails/active_job.rb in sentry-rails-4.1.4 vs lib/sentry/rails/active_job.rb in sentry-rails-4.1.5

- old
+ new

@@ -6,15 +6,19 @@ ).freeze def self.included(base) base.class_eval do around_perform do |job, block| - if already_supported_by_specific_integration?(job) - block.call - else - Sentry.with_scope do - capture_and_reraise_with_sentry(job, block) + if Sentry.initialized? + if already_supported_by_specific_integration?(job) + block.call + else + Sentry.with_scope do + capture_and_reraise_with_sentry(job, block) + end end + else + block.call end end end end