@@ -22,8 +22,9 @@ def initialize(existing_bid = nil)
22
22
@bidkey = "BID-" + @bid . to_s
23
23
@queued_jids = [ ]
24
24
@pending_jids = [ ]
25
- @incremental_push = Sidekiq . options . keys . include? ( :batch_push_interval )
26
- @batch_push_interval = Sidekiq . options [ :batch_push_interval ]
25
+ sidekiq_config = Sidekiq . const_defined? ( 'MAJOR' ) && Sidekiq ::MAJOR >= 7 ? ( Thread . current [ :sidekiq_capsule ] &.config || Sidekiq . default_configuration ) : Sidekiq . options
26
+ @incremental_push = sidekiq_config [ :batch_push_interval ] &.present?
27
+ @batch_push_interval = sidekiq_config [ :batch_push_interval ]
27
28
end
28
29
29
30
def description = ( description )
@@ -102,7 +103,7 @@ def jobs
102
103
103
104
pipeline . expire ( @bidkey , BID_EXPIRE_TTL )
104
105
105
- pipeline . sadd ( @bidkey + "-jids" , [ @queued_jids ] )
106
+ pipeline . sadd ( @bidkey + "-jids" , [ @queued_jids . flatten ] )
106
107
pipeline . expire ( @bidkey + "-jids" , BID_EXPIRE_TTL )
107
108
end
108
109
end
@@ -247,7 +248,7 @@ def enqueue_callbacks(event, bid)
247
248
already_processed , _ , callbacks , queue , parent_bid , callback_batch = Sidekiq . redis do |r |
248
249
r . multi do |pipeline |
249
250
pipeline . hget ( batch_key , event_name )
250
- pipeline . hset ( batch_key , event_name , true )
251
+ pipeline . hset ( batch_key , event_name , ' true' )
251
252
pipeline . smembers ( callback_key )
252
253
pipeline . hget ( batch_key , "callback_queue" )
253
254
pipeline . hget ( batch_key , "parent_bid" )
@@ -291,7 +292,7 @@ def enqueue_callbacks(event, bid)
291
292
else
292
293
# Otherwise finalize in sub batch complete callback
293
294
cb_batch = self . new
294
- cb_batch . callback_batch = true
295
+ cb_batch . callback_batch = ' true'
295
296
Sidekiq . logger . debug { "Adding callback batch: #{ cb_batch . bid } for batch: #{ bid } " }
296
297
cb_batch . on ( :complete , "Sidekiq::Batch::Callback::Finalize#dispatch" , opts )
297
298
cb_batch . jobs do
0 commit comments