Sha256: c24a2c731a00ae8fd1ef4dfd797ea108d21092058dc5f9a9a5c12b193a380be4

Contents?: true

Size: 523 Bytes

Versions: 9

Compression:

Stored size: 523 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)
          end
          raise e
        end
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
rollbar-1.3.2 lib/rollbar/delayed_job.rb
rollbar-1.3.1 lib/rollbar/delayed_job.rb
rollbar-1.3.0 lib/rollbar/delayed_job.rb
rollbar-1.2.13 lib/rollbar/delayed_job.rb
rollbar-1.2.12 lib/rollbar/delayed_job.rb
rollbar-1.2.11 lib/rollbar/delayed_job.rb
rollbar-1.2.10 lib/rollbar/delayed_job.rb
rollbar-1.2.9 lib/rollbar/delayed_job.rb
rollbar-1.2.8 lib/rollbar/delayed_job.rb