Sha256: ae47f6e8c476496c5f121b24220b2246dc50be02732c9f80a8b4f0fe686ce34c

Contents?: true

Size: 637 Bytes

Versions: 44

Compression:

Stored size: 637 Bytes

Contents

# based on http://bit.ly/VGdfVI

module Delayed
  module Plugins
    class Rollbar < Plugin
      module ReportErrors
        def error(job, error)
          # send the job object as the 'request data'
          ::Rollbar.report_exception(error, job)
          super if defined?(super)
        end
      end

      callbacks do |lifecycle|
        lifecycle.before(:invoke_job) do |job|
          payload = job.payload_object
          payload = payload.object if payload.is_a? Delayed::PerformableMethod
          payload.extend ReportErrors
        end
      end
    end
  end
end

Delayed::Worker.plugins << Delayed::Plugins::Rollbar

Version data entries

44 entries across 44 versions & 1 rubygems

Version Path
rollbar-0.8.3 lib/rollbar/delayed_job.rb
rollbar-0.8.2 lib/rollbar/delayed_job.rb
rollbar-0.8.1 lib/rollbar/delayed_job.rb
rollbar-0.8.0 lib/rollbar/delayed_job.rb