Skip to content

Instantly share code, notes, and snippets.

View HatemSat's full-sized avatar

Hatem Satouri HatemSat

View GitHub Profile
@madebydna
madebydna / import_job.rb
Last active July 1, 2022 14:59
Nested Batch workflow with Sidekiq Pro
class ImportJob
include Sidekiq::Worker
sidekiq_options :queue => :import, :retry => false, :backtrace => true
def perform(project_id)
# create master batch
a = Sidekiq::Batch.new
a.description = "Master Batch A"
a.on(:success, "ImportJob#on_success", {"step" => "a"})
logger.info "Master Batch A starting #{a.bid}"