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 Apr 30, 2024
1 parent 931e984 commit 4e58db7
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 @@ -21,9 +21,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 4e58db7

Please sign in to comment.