socialpandas / sidekiq-superworker

Directed acyclic graphs of Sidekiq jobs
MIT License
438 stars 34 forks source link

Batch jobs don't take given arguments #19

Closed russ closed 10 years ago

russ commented 10 years ago

From the documentation, I would think that you could pass in what you want to a batch job block. But I'm pretty sure that the batch arguments override anything that you pass to it. Here is some code for example.

Superworker.create(:VideoProcessingSuperWorker, :video_id, :profile_names) do
  DownloadWorker :video_id do
    batch profile_names: :profile_name do
      EncodingWorker :video_id, :profile_name
    end
  end
end

That is what I would like to happen. But what I really get is the same as doing this.

Superworker.create(:VideoProcessingSuperWorker, :video_id, :profile_names) do
  DownloadWorker :video_id do
    batch profile_names: :profile_name do
      EncodingWorker()
    end
  end
end

Each way passes in the current value of profile_name to the EncodingWorker.

tombenner commented 10 years ago

This should be fixed by 4c082cb88, and I've pushed out version 0.1.8, which includes it. Thanks for reporting it! Please let us know if you're still seeing any issues.

russ commented 10 years ago

Awesome! Works like a charm now. Thanks.