Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dont call as_json on Delayed::Backend::Sequel::Job #473

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion lib/rollbar/plugins/delayed_job/job_data.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@ def initialize(job)
end

def to_hash
job_data = job.as_json
job_data = if job.respond_to?(:as_json)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should extract this code into its own method. And also, we should ensure that job responds to #to_hash.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for reviewing this, I will work on those changes right now.

job.as_json
else
Hash[job.to_hash.map { |k, v| [k.to_s, v] }]
end

handler_parent = job_data['job'] ? job_data['job'] : job_data
handler_parent['handler'] = handler_data

Expand Down