Sha256: e955860ab0dae336daafadd0e13707139eea40e31479d98ccfce477f2f4550b6

Contents?: true

Size: 522 Bytes

Versions: 14

Compression:

Stored size: 522 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.report_exception(e, data)
          end
          raise e
        end
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
rollbar-1.2.7 lib/rollbar/delayed_job.rb
rollbar-1.2.6 lib/rollbar/delayed_job.rb
rollbar-1.2.5 lib/rollbar/delayed_job.rb
rollbar-1.2.4 lib/rollbar/delayed_job.rb
rollbar-1.2.3 lib/rollbar/delayed_job.rb
rollbar-1.2.2 lib/rollbar/delayed_job.rb
rollbar-1.2.1 lib/rollbar/delayed_job.rb
rollbar-1.2.0 lib/rollbar/delayed_job.rb
rollbar-1.1.0 lib/rollbar/delayed_job.rb
rollbar-1.0.1 lib/rollbar/delayed_job.rb
rollbar-1.0.0 lib/rollbar/delayed_job.rb
rollbar-0.13.2 lib/rollbar/delayed_job.rb
rollbar-0.13.1 lib/rollbar/delayed_job.rb
rollbar-0.13.0 lib/rollbar/delayed_job.rb