Sha256: 81a2fd35cb97ea5ba084af2a623b9060b5b26d6b2fa5bfad7bf355b670f31187

Contents?: true

Size: 561 Bytes

Versions: 18

Compression:

Stored size: 561 Bytes

Contents

module Rollbar
  module Delayed
    def self.wrap_worker
      return if @wrapped
      @wrapped = true

      ::Delayed::Worker.lifecycle.around(:invoke_job) do |job, *args, &block|
        begin
          block.call(job, *args)
        rescue Exception => e
          if job.attempts >= ::Rollbar.configuration.dj_threshold
            data = ::Rollbar.configuration.report_dj_data ? job : nil
            ::Rollbar.scope(:request => data).error(e, :use_exception_level_filters => true)
          end
          raise e
        end
      end
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
rollbar-2.2.1 lib/rollbar/delayed_job.rb
rollbar-2.2.0 lib/rollbar/delayed_job.rb
rollbar-2.1.2 lib/rollbar/delayed_job.rb
rollbar-2.1.1 lib/rollbar/delayed_job.rb
rollbar-2.1.0 lib/rollbar/delayed_job.rb
rollbar-2.0.2 lib/rollbar/delayed_job.rb
rollbar-2.0.1 lib/rollbar/delayed_job.rb
rollbar-2.0.0 lib/rollbar/delayed_job.rb
rollbar-1.5.3 lib/rollbar/delayed_job.rb
rollbar-1.5.2 lib/rollbar/delayed_job.rb
rollbar-1.5.1 lib/rollbar/delayed_job.rb
rollbar-1.5.0 lib/rollbar/delayed_job.rb
rollbar-1.4.5 lib/rollbar/delayed_job.rb
rollbar-1.4.4 lib/rollbar/delayed_job.rb
rollbar-1.4.3 lib/rollbar/delayed_job.rb
rollbar-1.4.2 lib/rollbar/delayed_job.rb
rollbar-1.4.1 lib/rollbar/delayed_job.rb
rollbar-1.4.0 lib/rollbar/delayed_job.rb