docbrown/app/workers/podcasts/enqueue_get_episodes_worker.rb

13 lines
404 B
Ruby

module Podcasts
class EnqueueGetEpisodesWorker
include Sidekiq::Job
sidekiq_options queue: :medium_priority, retry: 10
def perform
# `perform_bulk` expects an array of argument arrays we need to wrap the hashes.
job_params = Podcast.published.ids.map { |id| [{ "podcast_id" => id, "limit" => 5 }] }
Podcasts::GetEpisodesWorker.perform_bulk(job_params)
end
end
end