Skip to content

Commit 4e58db7

Browse files
committed
Lean on ActiveJob::Base to execute the job
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.
1 parent 931e984 commit 4e58db7

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

lib/delayed/job_wrapper.rb

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,7 @@ def display_name
2121
end
2222

2323
def perform
24-
ActiveJob::Callbacks.run_callbacks(:execute) do
25-
job.perform_now
26-
end
24+
ActiveJob::Base.execute(job_data)
2725
end
2826

2927
def encode_with(coder)

0 commit comments

Comments
 (0)