Skip to content

Commit

Permalink
Lean on ActiveJob::Base to execute the job
Browse files Browse the repository at this point in the history
This follows the other queue adapters in ActiveJob upstream, and Delayed::Job's queue adapter as well. Ensures the job deserialize is called within the executor block/execute callbacks along with perform. If the deserialize method is causing side effects like using ActiveSupport::CurrentAttributes they won't get cleared between deserialize and perform being invoked.
  • Loading branch information
caius committed Jan 15, 2024
1 parent 0efb1d5 commit e292ae8
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions lib/delayed/job_wrapper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ def display_name
end

def perform
ActiveJob::Callbacks.run_callbacks(:execute) do
job.perform_now
end
ActiveJob::Base.execute(job_data)
end

def encode_with(coder)
Expand Down

0 comments on commit e292ae8

Please sign in to comment.