Module: CanvasSync::JobBatches::Sidekiq::WorkerExtension

Included in:
SidekiqCallbackWorker
Defined in:
lib/canvas_sync/job_batches/sidekiq.rb

Instance Method Summary collapse

Instance Method Details

#batchObject



14
15
16
# File 'lib/canvas_sync/job_batches/sidekiq.rb', line 14

def batch
  Thread.current[CURRENT_BATCH_THREAD_KEY]
end

#batch_contextObject



18
19
20
# File 'lib/canvas_sync/job_batches/sidekiq.rb', line 18

def batch_context
  batch&.context || {}
end

#bidObject



10
11
12
# File 'lib/canvas_sync/job_batches/sidekiq.rb', line 10

def bid
  Thread.current[CURRENT_BATCH_THREAD_KEY].bid
end

#valid_within_batch?Boolean

Returns:

  • (Boolean)


22
23
24
# File 'lib/canvas_sync/job_batches/sidekiq.rb', line 22

def valid_within_batch?
  batch.valid?
end