File tree Expand file tree Collapse file tree 3 files changed +10
-2
lines changed
Expand file tree Collapse file tree 3 files changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -146,6 +146,7 @@ class Config
146146 attr_accessor :worker_callback
147147 attr_accessor :persist_models
148148 attr_accessor :currencies
149+ attr_accessor :worker_queue
149150
150151 def initialize
151152 @store_events = true
@@ -154,6 +155,7 @@ def initialize
154155 @worker_callback = Proc . new { }
155156 @persist_models = :all
156157 @currencies = %w( usd )
158+ @worker_queue = 'fabric'
157159 end
158160
159161 def persist? ( document )
Original file line number Diff line number Diff line change @@ -2,7 +2,9 @@ module Fabric
22 class WebhookWorker
33 include Sidekiq ::Worker
44
5- sidekiq_options queue : 'fabric'
5+ def self . perform_async ( ...)
6+ set ( queue : Fabric . config . worker_queue ) . perform_async ( ...)
7+ end
68
79 def perform ( event , webhook_class )
810 log_data = { event : event [ 'id' ] , webhook_class : webhook_class }
Original file line number Diff line number Diff line change @@ -3,7 +3,11 @@ class Worker
33 include Fabric
44 include Sidekiq ::Worker
55
6- sidekiq_options queue : 'fabric' , retry : false
6+ sidekiq_options retry : false
7+
8+ def self . perform_async ( ...)
9+ set ( queue : Fabric . config . worker_queue ) . perform_async ( ...)
10+ end
711
812 def perform ( operation , *args )
913 @log_data = { class : self . class . name , operation : operation , args : args }
You can’t perform that action at this time.
0 commit comments