Skip to content

Commit

Permalink
fixed SIGSEGV with the delayed_job plugin and Ruby 2.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
sbezboro committed Jan 10, 2014
1 parent cc72ce3 commit ae36b44
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 13 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
# Change Log

**0.12.5**
- Fixed SIGSEGV with the delayed_job plugin and Ruby 2.1.0

**0.12.4**
- Record controller context (controller#action) in reported items

Expand Down
18 changes: 6 additions & 12 deletions lib/rollbar/delayed_job.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,13 @@
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
lifecycle.around(:invoke_job) do |job, *args, &block|
begin
block.call(job, *args)
rescue Exception => e
::Rollbar.report_exception(e, job)
end
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion lib/rollbar/version.rb
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module Rollbar
VERSION = "0.12.4"
VERSION = "0.12.5"
end

0 comments on commit ae36b44

Please sign in to comment.