diff --git a/app/workers/podcasts/enqueue_get_episodes_worker.rb b/app/workers/podcasts/enqueue_get_episodes_worker.rb index 27a484c68..2042e006d 100644 --- a/app/workers/podcasts/enqueue_get_episodes_worker.rb +++ b/app/workers/podcasts/enqueue_get_episodes_worker.rb @@ -5,9 +5,9 @@ module Podcasts sidekiq_options queue: :medium_priority, retry: 10 def perform - Podcast.published.select(:id).find_each do |podcast| - Podcasts::GetEpisodesWorker.perform_async("podcast_id" => podcast.id, "limit" => 5) - end + # `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