blob: 5a9c4c708dc4af3ed845b61f4095a743c6502ad1 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
|
require 'delayed_job'
module ActiveJob
module QueueAdapters
class DelayedJobAdapter
class << self
def enqueue(job, *args)
JobWrapper.new.delay(queue: job.queue_name).perform(job, *args)
end
def enqueue_at(job, timestamp, *args)
JobWrapper.new.delay(queue: job.queue_name, run_at: timestamp).perform(job, *args)
end
end
class JobWrapper
def perform(job, *args)
job.new.perform_with_deserialization *args
end
end
end
end
end
|