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.12.3 lib/rollbar/delayed_job.rb
rollbar-0.12.2 lib/rollbar/delayed_job.rb
rollbar-0.12.1 lib/rollbar/delayed_job.rb
rollbar-0.12.0 lib/rollbar/delayed_job.rb
rollbar-0.11.8 lib/rollbar/delayed_job.rb
rollbar-0.11.7 lib/rollbar/delayed_job.rb
rollbar-0.11.6 lib/rollbar/delayed_job.rb
rollbar-0.11.5 lib/rollbar/delayed_job.rb
rollbar-0.11.4 lib/rollbar/delayed_job.rb
rollbar-0.11.3 lib/rollbar/delayed_job.rb
rollbar-0.11.2 lib/rollbar/delayed_job.rb
rollbar-0.11.1 lib/rollbar/delayed_job.rb
rollbar-0.10.14 lib/rollbar/delayed_job.rb
rollbar-0.10.12 lib/rollbar/delayed_job.rb
rollbar-0.10.11 lib/rollbar/delayed_job.rb
rollbar-0.10.10 lib/rollbar/delayed_job.rb
rollbar-0.10.9 lib/rollbar/delayed_job.rb
rollbar-0.10.8 lib/rollbar/delayed_job.rb
rollbar-0.10.7 lib/rollbar/delayed_job.rb
rollbar-0.10.6 lib/rollbar/delayed_job.rb