Sha256: 5b94a909e628277b9a569b70aba1a58968832ae20acb24161bd6a9662acf7abb

Contents?: true

Size: 996 Bytes

Versions: 31

Compression:

Stored size: 996 Bytes

Contents

if defined?(ActiveJob)
  module Sentry
    parent_job =
      if defined?(::ApplicationJob) && ::ApplicationJob.ancestors.include?(::ActiveJob::Base)
        ::ApplicationJob
      else
        ::ActiveJob::Base
      end

    class SendEventJob < parent_job
      # the event argument is usually large and creates noise
      self.log_arguments = false if respond_to?(:log_arguments=)

      # this will prevent infinite loop when there's an issue deserializing SentryJob
      if respond_to?(:discard_on)
        discard_on ActiveJob::DeserializationError
      else
        # mimic what discard_on does for Rails 5.0
        rescue_from ActiveJob::DeserializationError do |exception|
          logger.error "Discarded #{self.class} due to a #{exception}. The original exception was #{exception.cause.inspect}."
        end
      end

      def perform(event, hint = {})
        Sentry.send_event(event, hint)
      end
    end
  end
else
  module Sentry
    class SendEventJob; end
  end
end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
sentry-rails-5.16.1 app/jobs/sentry/send_event_job.rb
sentry-rails-5.15.2 app/jobs/sentry/send_event_job.rb
sentry-rails-5.15.1 app/jobs/sentry/send_event_job.rb
sentry-rails-5.15.0 app/jobs/sentry/send_event_job.rb
sentry-rails-5.14.0 app/jobs/sentry/send_event_job.rb
sentry-rails-5.13.0 app/jobs/sentry/send_event_job.rb
sentry-rails-5.12.0 app/jobs/sentry/send_event_job.rb
sentry-rails-5.11.0 app/jobs/sentry/send_event_job.rb
sentry-rails-5.10.0 app/jobs/sentry/send_event_job.rb
sentry-rails-5.9.0 app/jobs/sentry/send_event_job.rb
sentry-rails-5.8.0 app/jobs/sentry/send_event_job.rb
sentry-rails-5.7.0 app/jobs/sentry/send_event_job.rb
sentry-rails-5.6.0 app/jobs/sentry/send_event_job.rb
sentry-rails-5.5.0 app/jobs/sentry/send_event_job.rb
sentry-rails-5.4.2 app/jobs/sentry/send_event_job.rb
sentry-rails-5.4.1 app/jobs/sentry/send_event_job.rb
sentry-rails-5.4.0 app/jobs/sentry/send_event_job.rb
sentry-rails-5.3.1 app/jobs/sentry/send_event_job.rb
sentry-rails-5.3.0 app/jobs/sentry/send_event_job.rb
sentry-rails-5.2.1 app/jobs/sentry/send_event_job.rb