File tree Expand file tree Collapse file tree 2 files changed +12
-12
lines changed
lib/active_job/queue_adapters Expand file tree Collapse file tree 2 files changed +12
-12
lines changed Original file line number Diff line number Diff line change
1
+ * Add support for Sidekiq's transaction-aware client
2
+
3
+ * Jonathan del Strother*
4
+
1
5
* Remove QueAdapter from Active Job.
2
6
3
7
After maintaining Active Job QueAdapter by Rails and Que side
Original file line number Diff line number Diff line change @@ -18,21 +18,17 @@ module QueueAdapters
18
18
# Rails.application.config.active_job.queue_adapter = :sidekiq
19
19
class SidekiqAdapter
20
20
def enqueue ( job ) # :nodoc:
21
- # Sidekiq::Client does not support symbols as keys
22
- job . provider_job_id = Sidekiq ::Client . push \
23
- "class" => JobWrapper ,
24
- "wrapped" => job . class ,
25
- "queue" => job . queue_name ,
26
- "args" => [ job . serialize ]
21
+ job . provider_job_id = JobWrapper . set (
22
+ wrapped : job . class ,
23
+ queue : job . queue_name
24
+ ) . perform_async ( job . serialize )
27
25
end
28
26
29
27
def enqueue_at ( job , timestamp ) # :nodoc:
30
- job . provider_job_id = Sidekiq ::Client . push \
31
- "class" => JobWrapper ,
32
- "wrapped" => job . class ,
33
- "queue" => job . queue_name ,
34
- "args" => [ job . serialize ] ,
35
- "at" => timestamp
28
+ job . provider_job_id = JobWrapper . set (
29
+ wrapped : job . class ,
30
+ queue : job . queue_name ,
31
+ ) . perform_at ( timestamp , job . serialize )
36
32
end
37
33
38
34
class JobWrapper # :nodoc:
You can’t perform that action at this time.
0 commit comments