module Rollbar::Delayed
Attributes
Public Class Methods
Source
# File lib/rollbar/plugins/delayed_job/plugin.rb, line 82 def self.build_job_data(job) return nil unless ::Rollbar.configuration.report_dj_data JobData.new(job).to_hash end
Source
# File lib/rollbar/plugins/delayed_job/plugin.rb, line 48 def self.invoke_job_callback proc do |job, *args, &block| begin if Rollbar.configuration.dj_use_scoped_block data = Rollbar::Delayed.build_job_data(job) Rollbar.scoped(:request => data) { block.call(job, *args) } else block.call(job, *args) end rescue StandardError => e report(e, job) raise e end end end
Source
# File lib/rollbar/plugins/delayed_job/plugin.rb, line 65 def self.report(e, job) return if skip_report?(job) data = build_job_data(job) ::Rollbar.scope(:request => data) .error(e, :use_exception_level_filters => true) end
Source
# File lib/rollbar/plugins/delayed_job/plugin.rb, line 74 def self.skip_report?(job) handler = ::Rollbar.configuration.async_skip_report_handler return handler.call(job) if handler.respond_to?(:call) job.attempts < ::Rollbar.configuration.dj_threshold end
Source
# File lib/rollbar/plugins/delayed_job/plugin.rb, line 34 def self.wrap_worker return if wrapped ::Delayed::Worker.plugins << RollbarPlugin self.wrapped = true end
Source
# File lib/rollbar/plugins/delayed_job/plugin.rb, line 42 def self.wrap_worker! self.wrapped = false wrap_worker end