Class: Raif::PromptStudioBatchRunJob

Inherits:
ApplicationJob show all
Defined in:
app/jobs/raif/prompt_studio_batch_run_job.rb

Instance Method Summary collapse

Instance Method Details

#perform(batch_run:) ⇒ Object



6
7
8
9
10
11
12
# File 'app/jobs/raif/prompt_studio_batch_run_job.rb', line 6

def perform(batch_run:)
  batch_run.update!(started_at: Time.current)

  batch_run.items.where(status: "pending").find_each do |item|
    Raif::PromptStudioBatchRunItemJob.perform_later(item: item)
  end
end